<br><br><div class="gmail_quote">On Fri, Aug 7, 2009 at 6:10 PM, S.Selvam <span dir="ltr"><<a href="mailto:s.selvamsiva@gmail.com">s.selvamsiva@gmail.com</a>></span> wrote:<br><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><br>I am using pulldom to handle large xml files.It works fine, but i do not know how to store a particular set of  records(as xml) out of the recordset.<br>-----------------code---------<br>from xml.dom import pulldom<br>

hamlet_file = open("input_xml/inp_test.xml")<br>events = pulldom.parse(hamlet_file)<br>for (event, node) in events:<br>  if event == pulldom.START_ELEMENT:<br>    if node.tagName == "Record":<br>     events.expandNode(node)<br>

     print node  #this does not work as it is a object<br>------------------------------<br> <br>Whenever the node name is a Record,i process it. I want to store the all the nodes meeting my requirement.<br>  For eg,i need output as below,<br>

<br>         <Record><br>            <a><br>                 <a1>hi</a1><br>           </a><br>           <b><br>            ---<br>           </b><br>        </Record>      <br>

<br>         <Record><br>
            <a><br>
                 <a1>hello</a1><br>
           .<br>           .<br>Where input xml might contain 'n' number of Records.<br>I have been struggling to figure it out.I would be happy to get a solution for this.  <br clear="all"><br>-- <br>Yours,<br><font color="#888888">S.Selvam<br>


</font></blockquote></div><br>Hi all,<br>   I just found the solution,<br>         <b>node.toprettyxml()</b> <br>     has done it.<br><br>  <br clear="all"><br>-- <br>Yours,<br>S.Selvam<br>