<br><br><div><span class="gmail_quote">2006/1/19, Sbaush <<a href="mailto:sbaush@gmail.com">sbaush@gmail.com</a>>:</span><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
Hi all.<br>I've this XML:<br><br><manager><br> <request><br> <append mode="INPUT"><br> <method type="GOOD"/><br> <source address="<a href="http://127.0.0.1" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">
127.0.0.1</a>"/><br> <action option="OK"/><br> </append><br> </request><br></manager><br><br>How can i write this in a Python String? I would like use a xml.dom
implementation and not a banal print...print...<br>I can't do it... Is there anyone that can explain me what is the way?<br>Thank you!</blockquote><div><br><br>Another taste with amara:<br><br>import amara<br>doc = amara.create_document
(u"manager")<br>doc.manager.xml_append(doc.xml_create_element(u'request'))<br>doc.manager.request.xml_append(doc.xml_create_element(<br> u'append',<br> attributes={u'mode':u'INPUT'}))<br>doc.manager.request.append.xml_append
(doc.xml_create_element(<br> u'method',<br> attributes={u'type':u'GOOD'}))<br>doc.manager.request.append.xml_append(doc.xml_create_element(<br> u'source',<br> attributes={u'source':u'<a href="http://127.0.0.1">
127.0.0.1</a>'}))<br>doc.manager.request.append.xml_append(doc.xml_create_element(<br> u'action',<br> attributes={u'option':u'OK'}))<br>print doc.xml(indent='yes')<br> <br><br></div></div><br><br>
--<br><br>Luis Miguel