Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to install xml.dom.minidom in python

I would like to install minidom but I don't know how. Is it part of PyXML?

I have tried to use easy install with PyXML but it doesn't seem to work.

like image 946
user2040597 Avatar asked Nov 29 '13 11:11

user2040597


People also ask

What is XML DOM Minidom?

xml. dom. minidom is a minimal implementation of the Document Object Model interface, with an API similar to that in other languages. It is intended to be simpler than the full DOM and also significantly smaller.

Is there a DOM in Python?

The DOM is a standard tree representation for XML data. The Document Object Model is being defined by the W3C in stages, or “levels” in their terminology. The Python mapping of the API is substantially based on the DOM Level 2 recommendation. DOM applications typically start by parsing some XML into a DOM.

What is Toprettyxml?

toprettyxml. n.toprettyxml(indent='\t',newl='\n') Returns a string, plain or Unicode, with the XML source for the subtree rooted at n, using indent to indent nested tags and newl to end lines. toxml. n.toxml( )


1 Answers

Ahh, you don't need PyXML to use it, it's included in the standard library.

>>> import xml.dom.minidom
>>> help(xml.dom.minidom)

Help on module xml.dom.minidom in xml.dom:

NAME
    xml.dom.minidom - Simple implementation of the Level 1 DOM.

DESCRIPTION
    Namespaces and other minor Level 2 features are also supported.

    parse("foo.xml")

    parseString("<foo><bar/></foo>")

    Todo:
    =====
     * convenience methods for getting elements and text.
     * more testing
     * bring some of the writer and linearizer code into conformance with this
            interface
     * SAX 2 namespaces
...
...

Hope this helps!

like image 111
aIKid Avatar answered Sep 17 '22 08:09

aIKid