<div class="gmail_quote"><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;"><br>
   3. Re: About ODFPY links (Terry Reedy)<br> 
 <br><br><br>
<br>
<br><br>---------- Forwarded message ----------<br>From: Terry Reedy <<a href="mailto:tjreedy@udel.edu">tjreedy@udel.edu</a>><br>To: <a href="mailto:python-list@python.org">python-list@python.org</a><br>Date: Wed, 06 May 2009 19:02:59 -0400<br>
Subject: Re: About ODFPY links<br>shruti surve wrote:<br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
hey all,<br>
 For my project, i am using ODFpy open office spreadsheets. I am creating ledgers in python <a href="http://ie.ledger.py" target="_blank">ie.ledger.py</a> <<a href="http://ie.ledger.py" target="_blank">http://ie.ledger.py</a>>.  So when i run ledger.py, spreadsheet will be opened in open office. since ledger is made of number of accounts, i am creating multiple tables for all accounts in single spreadsheet. So, there are number of tables in one spreadsheet.  Now i want create links in each table of spreadsheet so that i can connect multiple tables. SO can anyone please tell me how to create links in odfpy..<br>

</blockquote>
<br>
The general answer to such questions is to make a minimal doc in some ODF application such of OOo that has the desired feature, save, open the doc as a zip file (unless saved as xml) and extract the pieces as xml. Then find the text that represents that feature.  There is a close correspondance between the xml and the internal document object model created by odfpy (and OOo, etc).<br>

<br>
In your case, make a spreadsheet with two table.  Give one one literal entry.  Give the other one entry that links to the first.  Then look in the xml to see how links are presented.  That should give a hint as to how to do the same in odfpy.  Then try to recreate the minimal doc with odfpy and look at the xml *it* produces.  If it looks similar enough, open with OOo to see what you get.<br>

<br>
tjr</blockquote><div><br><br>hi<br> i have tried that and i found <text:p><text:a xlink:href="#Sheet2" office:target-frame-name="_self">Investments</text:a></text:p>...so in my ledger.py i have written:<br>
<br>            para = P(text=lst_debit[i][0])<br>      <br>            lan=A(href=lst_debit[i][0],targetframename="_self",text=lst_debit[i][0])<br>           <br>            lan.addElement(para)<br>            tc.addElement(lan)<br>
           <br>            tr.addElement(tc)<br>(where lst_debit[i][0] is my account name coming from database)<br><br> but still its not coming erroris :<br>in addElement<br>odf.element.IllegalChild: <text:p> is not allowed in <text:a><br>
  <br><br>i have tried it with:<br><br>tc.addElement(P(text=lst_credit[i][0]),A(href=lst_debit[i][0],targetframename="_self"))<br><br>but still its not coming, it is not giving any error, but not creating link, giving simple text field.. so i basically i am not getting how to manage P and A properties of cell together<br>
<br>Regards<br>shruti surve<br></div></div><br>