[XML-SIG] PrettyPrint question
Uche Ogbuji
uche.ogbuji at fourthought.com
Thu Oct 14 05:25:13 CEST 2004
On Tue, 2004-10-12 at 10:39, Dave Kuhlman wrote:
> On Tue, Oct 12, 2004 at 03:58:29PM +0100, Brian Reynolds wrote:
> > Hi All,
> >
> > I'm using the PrettyPrint function to print a XSD contained in a DOM
> > tree. What I would like to do is ensure that the attributes are printed
> > with the double-quotes instead of single quotes.
> > Is there any way of doing this? I'm using pyxml v0.8.3.
> >
>
> What about trying the following:
>
> from xml.dom import minidom
> doc = minidom.parse('mydoc.xml')
> root = doc.documentElement
> print root.toprettyxml()
Yes. That's a better alternative for a variety of reasons.
--
Uche Ogbuji Fourthought, Inc.
http://uche.ogbuji.net http://4Suite.org http://fourthought.com
A hands-on introduction to ISO Schematron - http://www-106.ibm.com/developerworks/edu/x-dw-xschematron-i.html
Schematron abstract patterns - http://www.ibm.com/developerworks/xml/library/x-stron.html
Wrestling HTML (using Python) - http://www.xml.com/pub/a/2004/09/08/pyxml.html
Enterprise data goes high fashion - http://www.adtmag.com/article.asp?id=10061
Principles of XML design: Considering container elements - http://www-106.ibm.com/developerworks/xml/library/x-contain.html
Hacking XML Hacks - http://www-106.ibm.com/developerworks/xml/library/x-think26.html
A survey of XML standards - http://www-106.ibm.com/developerworks/xml/library/x-stand4/
More information about the XML-SIG
mailing list