470,580 Members | 2,209 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 470,580 developers. It's quick & easy.

XML and Python

***
Does Python support XML like VB.NET does? If it does, could someone
provide a link or example code.

Thanks :)

e.g.,
filename: productsandservices.xml
<products>
<name>Computer</name>
<price>500.00</price>
<name2>Keyboard</name2>
<price2>5.00</price2>
</products>
Jul 18 '05 #1
1 1083
In data Mon, 19 Jul 2004 23:12:54 -0700, *** ha scritto:
Does Python support XML like VB.NET does? If it does, could someone
provide a link or example code.

Thanks :)


VB.NET does not support XML (MSR's C-omega does), .NET has support for it.
Anyway, the Python standard library has some (quite enough for many things)
support for XML parsing and the creation of XML DOMs, so you can represent
a DOM Level 2 with xml.dom
(http://docs.python.org/lib/module-xml.dom.html), a light-weight DOM (Level
1) with xml.dom.minidom
(http://docs.python.org/lib/module-xml.dom.minidom.html), use expat based
parser for fast parsing
(http://docs.python.org/lib/module-xm...ers.expat.html) or use SAX
(http://docs.python.org/lib/module-xml.sax.html) and much more. The SAX
parser is similar to XmlTextReader in .NET except that SAX is a push
parser, XmlReaders are pull parsers.

Your second option is to take a look at what third parties offer to
you...something like full PyXml, libxml2 bindings, 4Suite, xmltramp and so
on... for an overview see these articles:

http://www.xml.com/pub/au/84

Bye

--
Lawrence
"In IE we trust"
Jul 18 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.

By using this site, you agree to our Privacy Policy and Terms of Use.