Confused: looking for a simple XML parser

R

Rex

Hello,

I am a Python programmer facing my first small XML project. I am
looking to find a simple tool to take an XSD file and convert the XSD
tree structure to another text format (e.g. an adjacency matrix for
the tree's graph), or convert one xml file format definition into
another, non-xml one. I don't need to validate XML documents created
by this schema or do anything else fancy. I just need to be able to
traverse this tree programmatically and find which child attributes
belong to which parent attributes, etc.

There seem to be so many Python libraries and programs out there that
I don't know what to use.

What tool should I use?

Thanks,
Rex
 
K

Kay Schluehr

Hello,

I am a Python programmer facing my first small XML project. I am
looking to find a simple tool to take an XSD file and convert the XSD
tree structure to another text format (e.g. an adjacency matrix for
the tree's graph), or convert one xml file format definition into
another, non-xml one. I don't need to validate XML documents created
by this schema or do anything else fancy. I just need to be able to
traverse this tree programmatically and find which child attributes
belong to which parent attributes, etc.

There seem to be so many Python libraries and programs out there that
I don't know what to use.

What tool should I use?

Thanks,
Rex

Many people seem to be happy with elementree and it might be the most
adequate parser for your purposes. Personally I'm sticking with expat
and define handlers to build custom data structures. Both expat and
elementree are available in the standard library.

http://docs.python.org/lib/module-xml.parsers.expat.html
http://docs.python.org/lib/module-xml.etree.ElementTree.html
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,765
Messages
2,569,568
Members
45,042
Latest member
icassiem

Latest Threads

Top