Another alternative to parsing XML is beautiful soup. <div><br></div><div>Website:</div><div><a href="http://www.crummy.com/software/BeautifulSoup/">http://www.crummy.com/software/BeautifulSoup/</a> </div><div><br></div><div>
Documentation for parsing xml:</div><div><a href="http://www.crummy.com/software/BeautifulSoup/documentation.html#Parsing%20XML">http://www.crummy.com/software/BeautifulSoup/documentation.html#Parsing%20XML</a></div><div>
<br></div><div>sample code:</div><div><div><div>from BeautifulSoup import BeautifulStoneSoup</div><div>xml = "<doc><tag1>Contents 1<tag2>Contents 2<tag1>Contents 3"</div><div>soup = BeautifulStoneSoup(xml)</div>
<div>print soup.prettify()</div><div># <doc></div><div># <tag1></div><div># Contents 1</div><div># <tag2></div><div># Contents 2</div><div># </tag2></div><div># </tag1></div><div>
# <tag1></div>
<div># Contents 3</div><div># </tag1></div><div># </doc></div></div><div><br>
<br><br><div class="gmail_quote">On Mon, Mar 8, 2010 at 3:48 AM, Hichiro <span dir="ltr"><<a href="mailto:vinh.dhbk@gmail.com">vinh.dhbk@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
<br>Hi all!<br>I'm trying to read one by one record in XML file to find
out its tag and attribute for schema matching. But I haven't done yet.
So, could you help me?!<br>Thanks so much! :)<div><div></div><div class="h5"><br clear="all">
<font color="#888888"><br>
</font><br clear="all"><br>-- <br>Best regards,<br>Vinh NV<br>CNPM K50 DHBKHN<br>Y! : Vinh.dhbk<br>Sky : Vinh.dhbk<br>84 976 314 988<br>
</div></div><br>_______________________________________________<br>
Tutor maillist - <a href="mailto:Tutor@python.org">Tutor@python.org</a><br>
To unsubscribe or change subscription options:<br>
<a href="http://mail.python.org/mailman/listinfo/tutor" target="_blank">http://mail.python.org/mailman/listinfo/tutor</a><br>
<br></blockquote></div><br></div></div>