minidom sample code

M

Miranda Evans

Seeking sample python script that makes use of of xml.dom.minidom.
Specifically, would like to see code where xml.dom.minidom is used to
create an output file the contents of which is an XML document.

Ideally, the output file would a simple XML document such as the one
below.

<?xml version="1.0" ?>
<TrivialRootTag>TrivialContents</TrivialRootTag>

Workstation O/S is Win2K; version of Python is 2.2.

Can anyone point me to a documentation/link/whatever that provides
such sample code? Thank you.
 
B

Bengt Richter

Seeking sample python script that makes use of of xml.dom.minidom.
Specifically, would like to see code where xml.dom.minidom is used to
create an output file the contents of which is an XML document.

Ideally, the output file would a simple XML document such as the one
below.

<?xml version="1.0" ?>
<TrivialRootTag>TrivialContents</TrivialRootTag>

Workstation O/S is Win2K; version of Python is 2.2.

Can anyone point me to a documentation/link/whatever that provides
such sample code? Thank you.

Did you look at the xml.dom.minidom docs at

http://www.python.org/doc/current/lib/module-xml.dom.minidom.html

Taken from the first page verbatim:
<DOM Text node "Some textu...">

Using the methods described on the second page:
'<?xml version="1.0" ?>\n<some_tag>Some textual content.</some_tag>'

or:
'<?xml version="1.0" ?>\n<some_tag>\n\tSome textual content.\n</some_tag>\n'

and showing what that looks like printed:
<?xml version="1.0" ?>
<some_tag>
Some textual content.
</some_tag>

I'll leave it to you to change the spelling to match your example ;-)

Regards,
Bengt Richter
 
M

Manuel Huesser

from xml.dom.minidom import getDOMImplementation

It needs much more time to import this package than
any other one. As much that it's perceptible compared
to other packages.

Because my main debugger is print i don't like if an
application needs much more time. Is there a way around?

Manuel
 

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
473,764
Messages
2,569,567
Members
45,042
Latest member
icassiem

Latest Threads

Top