By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
445,743 Members | 1,058 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 445,743 IT Pros & Developers. It's quick & easy.

Including standalone="no" in XML declaration

P: n/a
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
<?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

Any help would be greatly appreciated.


Apr 14 '06 #1
Share this question for a faster answer!
Share on Google+

This discussion thread is closed

Replies have been disabled for this discussion.