0
  "   ˆl–äY>” TËm
q@µq¦n6ò˜´oÁƒh¹À¿      DRIVER=processor
MODALIAS=x86cpu:vendor:0000:family:000F:model:0006:feature:,0000,0001,0002,0003,0004,0005,0006,0007,0008,0009,000B,000C,000D,000E,000F,0010,0011,0013,0017,0018,0019,001A,001C,002B,0034,003D,0068,006F,0072,0074,0076,007D,0080,008D,0095,009F,00C0,00F3,00FD,0164,0165

     ˆ¾Áƒh¹À¿      online
     ˆ¾Áƒh¹À¿      online
  C   	ˆl–Ým_JJh¥ ² ¸È®41hßÂ„Bè_‡I|¥Šèªa–äY>” TËm
q@¹q–î	õ1hßÂ +£    	:mod:`xml.dom.minidom` --- Minimal DOM implementation
=====================================================

.. module:: xml.dom.minidom
   :synopsis: Minimal Document Object Model (DOM) implementation.
.. moduleauthor:: Paul Prescod <paul@prescod.net>
.. sectionauthor:: Paul Prescod <paul@prescod.net>
.. sectionauthor:: Martin v. LÃ¶wis <martin@v.loewis.de>


.. versionadded:: 2.0

**Source code:** :source:`Lib/xml/dom/minidom.py`

--------------

:mod:`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.  Users who are
not already proficient with the DOM should consider using the
:mod:`xml.etree.ElementTree` module for their XML processing instead


.. warning::

   The :mod:`xml.dom.minidom` module is not secure against
   maliciously constructed data.  If you need to parse untrusted or
   unauthenticated data see :ref:`xml-vulnerabilities`.


DOM applications typically start by parsing some XML into a DOM.  With
:mod:`xml.dom.minidom`, this is done through the parse functions::

   from xml.dom.minidom import parse, parseString

   dom1 = parse('c:\\temp\\mydata.xml') # parse an XML file by name

   datasource = open('c:\\temp\\mydata.xml')
   dom2 = parse(datasource)   # parse an open file

   dom3 = parseString('<myxml>Some data<empty/> some more data</myxml>')

The :func:`parse` function can take either a filename or an open file object.


.. function:: parse(filename_or_file[, parser[, bufsize]])

   Return a :class:`Document` from the given input. *filename_or_file* may be
   either a file name, or a file-like object. *parser*, if given, must be a SAX2
   parser object. This function will change the document handler of the parser and
   activate namespace support; other parser configuration (like setting an entity
   resolver) must have been done in advance.

If you have XML in a string, you can use the :func:`parseString` function
instead:


.. function:: parseString(string[, parser])

   Return a :class:`Document` that represents the *string*. This method creates a
   :class:`StringIO` object for the string and passes that on to :func:`parse`.

Both functions return a :class:`Document` object representing the content of the
document.

What the :func:`parse` and :func:`parseString` functions do is connect an XML
parser with a "DOM builder" that can accept parse events from any SAX parser and
convert them into a DOM tree.  The name of the functions are perhaps misleading,
but are easy to grasp when learning the interfaces.  The parsing of the document
will be completed before these functions return; it's simply that these
functions do not provide a parser implementation themselves.

You can also create a :class:`Document` by calling a method on a "DOM
Implementation" object.  You can get this object either by calling the
:func:`getDOMImplementation` function in the :mod:`xml.dom` package or the
:mod:`xml.dom.minidom` module. Using the implementation from the
:mod:`xml.dom.minidom` module will always return a :class:`Document` instance
from the minidom implementation, while the version from :mod:`xml.dom` may
provide an alternate implementation (this is likely if you have the `PyXML
package <http://pyxml.sourceforge.net/>`_ installed).  Once you have a
:class:`Document`, you can add child nodes to it to populate the DOM::

   from xml.dom.minidom import getDOMImplementation

   impl = getDOMImplementation()

   newdoc = impl.createDocument(None, "some_tag", None)
   top_e