[XML-SIG] Re: Minidom empty script element bug

Uche Ogbuji Uche.Ogbuji at fourthought.com
Tue Mar 22 21:51:42 CET 2005


On Wed, 2005-03-16 at 08:53 +0100, Walter Dörwald wrote:
> Martin v. Löwis sagte:
> > Derek Basch wrote:
> > >[...]
> >> How do I get minidom to NOT render an empty script element? Should I submit a bug report?
> >
> > That said, I think there is a simple solution: add an empty Text node to the script element:
> >
> > script_node_0.appendChild(doc.createText(u""))
> >
> > [Disclaimer: this is untested; from reading the source, I think it  should work]
> 
> If this doesn't work, you might want to try XIST (http://www.livinglogic.de/Python/xist)
> instead of minidom. XIST knows that the script element is not EMPTY, and when the
> output is in HTML compatible XML an end tag will be produced:

And right on cue :-)

http://www.xml.com/pub/a/2005/03/16/py-xml.html


-- 
Uche Ogbuji                                    Fourthought, Inc.
http://uche.ogbuji.net    http://4Suite.org    http://fourthought.com
Use CSS to display XML, part 2 - http://www-128.ibm.com/developerworks/edu/x-dw-x-xmlcss2-i.html
Introducing the Amara XML Toolkit - http://www.xml.com/pub/a/2005/01/19/amara.html
Gems from the Mines: 2002 to 2003 - http://www.xml.com/pub/a/2005/03/02/pyxml.html
Be humble, not imperial (in design) - http://www.adtmag.com/article.asp?id=10286
Querying WordNet as XML - http://www.ibm.com/developerworks/xml/library/x-think29.html
Packaging XSLT lookup tables as EXSLT functions - http://www.ibm.com/developerworks/xml/library/x-tiplook2.html



More information about the XML-SIG mailing list