Re: How to add standalone="no" to my xml declaration

"Chuck Bearden" <[email protected]>
Newsgroups gmane.comp.python.xml
Message-ID <[email protected]>
There is a class variable in xml.dom.minidom.Document declared for the
standalone value, and it is copied to the cloned node in the cloneNode
method of the Document object, and there is an accessor
'_get_standalone' to get the value, but otherwise it doesn't appear to
be used at all in the minidom code.

Chuck

On 4/14/06, Stephen Briley <[email protected]> wrote:
> I'm trying to learn about Python and XML.  I would like to be able to add
> standalone="no" to my xml declaration when writing an xml file, but I am
> unable to figure out how.  So far, I have the following code:
>
>  import xml.dom.minidom
>  doc2 = xml.dom.minidom.Document()
>  print doc2.toxml('iso-8859-1')
>
>  Which produces the following XML declaration:
>  <?xml version="1.0" encoding="iso-8859-1"?>
>
>  However, my goal is to have the XML declaration look like the following:
>  <?xml version="1.0" encoding="iso-8859-1" standalone="no" ?>
>
>  The following link mentions "standalone" as a Document class variable, but
> I am unsure how to make this work or even if I am on the right track.
> http://epydoc.sourceforge.net/stdlib/private/_xmlplus.dom.minidom.Document-class.html#encoding
>
>  Any help would be greatly appreciated.
>
>  Thanks.
> _______________________________________________
> XML-SIG maillist  -  [email protected]
> http://mail.python.org/mailman/listinfo/xml-sig
>
>
>
_______________________________________________
XML-SIG maillist  -  [email protected]
http://mail.python.org/mailman/listinfo/xml-sig
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.