read/write XML

T

Torsten Mohr

Hi,

i just took a look into the python documentation regarding XML.
XMLDOM look quite big, so i took another look at "minidom".

So is minidom the preferred way to go to read an XML, handle
its data and also write XML?

In the example (13.7.2, SLideshow) the structure seems to be
read into a "dom", but to check its structure against some
criteria seems to be completely missing, e.g.:

- only defined elements used
- at least one slide in the slideshow
- others ...

How can i check a "dom" against these criteria?


Best regards,
Torsten.
 
U

Uche Ogbuji

Torsten Mohr said:
Hi,

i just took a look into the python documentation regarding XML.
XMLDOM look quite big, so i took another look at "minidom".

So is minidom the preferred way to go to read an XML, handle
its data and also write XML?

Depends on many other things.
In the example (13.7.2, SLideshow) the structure seems to be
read into a "dom", but to check its structure against some
criteria seems to be completely missing, e.g.:

- only defined elements used
- at least one slide in the slideshow
- others ...

How can i check a "dom" against these criteria?

You can use DTD, RELAX NG or Schematron. For DTD use PyXML or
libxml2. For RELAX NG, use 4Suite, XVIF stand-alone or libxml2. For
Schematron use Scimitar or an XSLT Schematron implementation.

We can offer more detailed answers if you ask more detailed questions.

--
Uche Ogbuji Fourthought, Inc.
http://uche.ogbuji.net http://4Suite.org http://fourthought.com
Decomposition, Process, Recomposition -
http://www.xml.com/pub/a/2004/07/28/py-xml.html
Perspective on XML: Steady steps spell success with Google -
http://www.adtmag.com/article.asp?id=9663
Managing XML libraries - http://www.adtmag.com/article.asp?id=9160
Commentary on "Objects. Encapsulation. XML?" -
http://www.adtmag.com/article.asp?id=9090
Harold's Effective XML -
http://www.ibm.com/developerworks/xml/library/x-think25.html
A survey of XML standards -
http://www-106.ibm.com/developerworks/xml/library/x-stand4/
 

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
474,294
Messages
2,571,522
Members
48,230
Latest member
TatianaGol

Latest Threads

Top