Commit | Line | Data |
---|---|---|
920dae64 AT |
1 | <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> |
2 | <html> | |
3 | <head> | |
4 | <link rel="STYLESHEET" href="lib.css" type='text/css' /> | |
5 | <link rel="SHORTCUT ICON" href="../icons/pyfav.png" type="image/png" /> | |
6 | <link rel='start' href='../index.html' title='Python Documentation Index' /> | |
7 | <link rel="first" href="lib.html" title='Python Library Reference' /> | |
8 | <link rel='contents' href='contents.html' title="Contents" /> | |
9 | <link rel='index' href='genindex.html' title='Index' /> | |
10 | <link rel='last' href='about.html' title='About this document...' /> | |
11 | <link rel='help' href='about.html' title='About this document...' /> | |
12 | <link rel="next" href="node652.html" /> | |
13 | <link rel="prev" href="module-xml.dom.html" /> | |
14 | <link rel="parent" href="module-xml.dom.html" /> | |
15 | <link rel="next" href="node652.html" /> | |
16 | <meta name='aesop' content='information' /> | |
17 | <title>13.6.1 Module Contents</title> | |
18 | </head> | |
19 | <body> | |
20 | <DIV CLASS="navigation"> | |
21 | <div id='top-navigation-panel' xml:id='top-navigation-panel'> | |
22 | <table align="center" width="100%" cellpadding="0" cellspacing="2"> | |
23 | <tr> | |
24 | <td class='online-navigation'><a rel="prev" title="13.6 xml.dom " | |
25 | href="module-xml.dom.html"><img src='../icons/previous.png' | |
26 | border='0' height='32' alt='Previous Page' width='32' /></A></td> | |
27 | <td class='online-navigation'><a rel="parent" title="13.6 xml.dom " | |
28 | href="module-xml.dom.html"><img src='../icons/up.png' | |
29 | border='0' height='32' alt='Up One Level' width='32' /></A></td> | |
30 | <td class='online-navigation'><a rel="next" title="13.6.2 Objects in the" | |
31 | href="node652.html"><img src='../icons/next.png' | |
32 | border='0' height='32' alt='Next Page' width='32' /></A></td> | |
33 | <td align="center" width="100%">Python Library Reference</td> | |
34 | <td class='online-navigation'><a rel="contents" title="Table of Contents" | |
35 | href="contents.html"><img src='../icons/contents.png' | |
36 | border='0' height='32' alt='Contents' width='32' /></A></td> | |
37 | <td class='online-navigation'><a href="modindex.html" title="Module Index"><img src='../icons/modules.png' | |
38 | border='0' height='32' alt='Module Index' width='32' /></a></td> | |
39 | <td class='online-navigation'><a rel="index" title="Index" | |
40 | href="genindex.html"><img src='../icons/index.png' | |
41 | border='0' height='32' alt='Index' width='32' /></A></td> | |
42 | </tr></table> | |
43 | <div class='online-navigation'> | |
44 | <b class="navlabel">Previous:</b> | |
45 | <a class="sectref" rel="prev" href="module-xml.dom.html">13.6 xml.dom </A> | |
46 | <b class="navlabel">Up:</b> | |
47 | <a class="sectref" rel="parent" href="module-xml.dom.html">13.6 xml.dom </A> | |
48 | <b class="navlabel">Next:</b> | |
49 | <a class="sectref" rel="next" href="node652.html">13.6.2 Objects in the</A> | |
50 | </div> | |
51 | <hr /></div> | |
52 | </DIV> | |
53 | <!--End of Navigation Panel--> | |
54 | ||
55 | <H2><A NAME="SECTION0015610000000000000000"> | |
56 | 13.6.1 Module Contents</A> | |
57 | </H2> | |
58 | ||
59 | <P> | |
60 | The <tt class="module">xml.dom</tt> contains the following functions: | |
61 | ||
62 | <P> | |
63 | <dl><dt><table cellpadding="0" cellspacing="0"><tr valign="baseline"> | |
64 | <td><nobr><b><tt id='l2h-4353' xml:id='l2h-4353' class="function">registerDOMImplementation</tt></b>(</nobr></td> | |
65 | <td><var>name, factory</var>)</td></tr></table></dt> | |
66 | <dd> | |
67 | Register the <var>factory</var> function with the name <var>name</var>. The | |
68 | factory function should return an object which implements the | |
69 | <tt class="class">DOMImplementation</tt> interface. The factory function can return | |
70 | the same object every time, or a new one for each call, as appropriate | |
71 | for the specific implementation (e.g. if that implementation supports | |
72 | some customization). | |
73 | </dl> | |
74 | ||
75 | <P> | |
76 | <dl><dt><table cellpadding="0" cellspacing="0"><tr valign="baseline"> | |
77 | <td><nobr><b><tt id='l2h-4354' xml:id='l2h-4354' class="function">getDOMImplementation</tt></b>(</nobr></td> | |
78 | <td><var></var><big>[</big><var>name</var><big>[</big><var>, features</var><big>]</big><var></var><big>]</big><var></var>)</td></tr></table></dt> | |
79 | <dd> | |
80 | Return a suitable DOM implementation. The <var>name</var> is either | |
81 | well-known, the module name of a DOM implementation, or | |
82 | <code>None</code>. If it is not <code>None</code>, imports the corresponding | |
83 | module and returns a <tt class="class">DOMImplementation</tt> object if the import | |
84 | succeeds. If no name is given, and if the environment variable | |
85 | <a class="envvar" id='l2h-4359' xml:id='l2h-4359'>PYTHON_DOM</a> is set, this variable is used to find the | |
86 | implementation. | |
87 | ||
88 | <P> | |
89 | If name is not given, this examines the available implementations to | |
90 | find one with the required feature set. If no implementation can be | |
91 | found, raise an <tt class="exception">ImportError</tt>. The features list must be a | |
92 | sequence of <code>(<var>feature</var>, <var>version</var>)</code> pairs which are | |
93 | passed to the <tt class="method">hasFeature()</tt> method on available | |
94 | <tt class="class">DOMImplementation</tt> objects. | |
95 | </dl> | |
96 | ||
97 | <P> | |
98 | Some convenience constants are also provided: | |
99 | ||
100 | <P> | |
101 | <dl><dt><b><tt id='l2h-4355' xml:id='l2h-4355'>EMPTY_NAMESPACE</tt></b></dt> | |
102 | <dd> | |
103 | The value used to indicate that no namespace is associated with a | |
104 | node in the DOM. This is typically found as the | |
105 | <tt class="member">namespaceURI</tt> of a node, or used as the <var>namespaceURI</var> | |
106 | parameter to a namespaces-specific method. | |
107 | ||
108 | <span class="versionnote">New in version 2.2.</span> | |
109 | ||
110 | </dd></dl> | |
111 | ||
112 | <P> | |
113 | <dl><dt><b><tt id='l2h-4356' xml:id='l2h-4356'>XML_NAMESPACE</tt></b></dt> | |
114 | <dd> | |
115 | The namespace URI associated with the reserved prefix <code>xml</code>, as | |
116 | defined by | |
117 | <em class="citetitle"><a | |
118 | href="http://www.w3.org/TR/REC-xml-names/" | |
119 | title="Namespaces in XML" | |
120 | >Namespaces in XML</a></em> | |
121 | (section 4). | |
122 | ||
123 | <span class="versionnote">New in version 2.2.</span> | |
124 | ||
125 | </dd></dl> | |
126 | ||
127 | <P> | |
128 | <dl><dt><b><tt id='l2h-4357' xml:id='l2h-4357'>XMLNS_NAMESPACE</tt></b></dt> | |
129 | <dd> | |
130 | The namespace URI for namespace declarations, as defined by | |
131 | <em class="citetitle"><a | |
132 | href="http://www.w3.org/TR/DOM-Level-2-Core/core.html" | |
133 | title="Document | |
134 | Object Model (DOM) Level 2 Core Specification" | |
135 | >Document | |
136 | Object Model (DOM) Level 2 Core Specification</a></em> (section 1.1.8). | |
137 | ||
138 | <span class="versionnote">New in version 2.2.</span> | |
139 | ||
140 | </dd></dl> | |
141 | ||
142 | <P> | |
143 | <dl><dt><b><tt id='l2h-4358' xml:id='l2h-4358'>XHTML_NAMESPACE</tt></b></dt> | |
144 | <dd> | |
145 | The URI of the XHTML namespace as defined by | |
146 | <em class="citetitle"><a | |
147 | href="http://www.w3.org/TR/xhtml1/" | |
148 | title="XHTML 1.0: The Extensible | |
149 | HyperText Markup Language" | |
150 | >XHTML 1.0: The Extensible | |
151 | HyperText Markup Language</a></em> (section 3.1.1). | |
152 | ||
153 | <span class="versionnote">New in version 2.2.</span> | |
154 | ||
155 | </dd></dl> | |
156 | ||
157 | <P> | |
158 | In addition, <tt class="module">xml.dom</tt> contains a base <tt class="class">Node</tt> class and | |
159 | the DOM exception classes. The <tt class="class">Node</tt> class provided by this | |
160 | module does not implement any of the methods or attributes defined by | |
161 | the DOM specification; concrete DOM implementations must provide | |
162 | those. The <tt class="class">Node</tt> class provided as part of this module does | |
163 | provide the constants used for the <tt class="member">nodeType</tt> attribute on | |
164 | concrete <tt class="class">Node</tt> objects; they are located within the class | |
165 | rather than at the module level to conform with the DOM | |
166 | specifications. | |
167 | ||
168 | <P> | |
169 | ||
170 | <DIV CLASS="navigation"> | |
171 | <div class='online-navigation'> | |
172 | <p></p><hr /> | |
173 | <table align="center" width="100%" cellpadding="0" cellspacing="2"> | |
174 | <tr> | |
175 | <td class='online-navigation'><a rel="prev" title="13.6 xml.dom " | |
176 | href="module-xml.dom.html"><img src='../icons/previous.png' | |
177 | border='0' height='32' alt='Previous Page' width='32' /></A></td> | |
178 | <td class='online-navigation'><a rel="parent" title="13.6 xml.dom " | |
179 | href="module-xml.dom.html"><img src='../icons/up.png' | |
180 | border='0' height='32' alt='Up One Level' width='32' /></A></td> | |
181 | <td class='online-navigation'><a rel="next" title="13.6.2 Objects in the" | |
182 | href="node652.html"><img src='../icons/next.png' | |
183 | border='0' height='32' alt='Next Page' width='32' /></A></td> | |
184 | <td align="center" width="100%">Python Library Reference</td> | |
185 | <td class='online-navigation'><a rel="contents" title="Table of Contents" | |
186 | href="contents.html"><img src='../icons/contents.png' | |
187 | border='0' height='32' alt='Contents' width='32' /></A></td> | |
188 | <td class='online-navigation'><a href="modindex.html" title="Module Index"><img src='../icons/modules.png' | |
189 | border='0' height='32' alt='Module Index' width='32' /></a></td> | |
190 | <td class='online-navigation'><a rel="index" title="Index" | |
191 | href="genindex.html"><img src='../icons/index.png' | |
192 | border='0' height='32' alt='Index' width='32' /></A></td> | |
193 | </tr></table> | |
194 | <div class='online-navigation'> | |
195 | <b class="navlabel">Previous:</b> | |
196 | <a class="sectref" rel="prev" href="module-xml.dom.html">13.6 xml.dom </A> | |
197 | <b class="navlabel">Up:</b> | |
198 | <a class="sectref" rel="parent" href="module-xml.dom.html">13.6 xml.dom </A> | |
199 | <b class="navlabel">Next:</b> | |
200 | <a class="sectref" rel="next" href="node652.html">13.6.2 Objects in the</A> | |
201 | </div> | |
202 | </div> | |
203 | <hr /> | |
204 | <span class="release-info">Release 2.4.2, documentation updated on 28 September 2005.</span> | |
205 | </DIV> | |
206 | <!--End of Navigation Panel--> | |
207 | <ADDRESS> | |
208 | See <i><a href="about.html">About this document...</a></i> for information on suggesting changes. | |
209 | </ADDRESS> | |
210 | </BODY> | |
211 | </HTML> |