1 <?xml version="1.0" encoding="ascii"?>
2 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
3 "DTD/xhtml1-transitional.dtd">
4 <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
6 <title>lxml.html.XHTMLParser</title>
7 <link rel="stylesheet" href="epydoc.css" type="text/css" />
8 <script type="text/javascript" src="epydoc.js"></script>
11 <body bgcolor="white" text="black" link="blue" vlink="#204080"
13 <!-- ==================== NAVIGATION BAR ==================== -->
14 <table class="navbar" border="0" width="100%" cellpadding="0"
15 bgcolor="#a0c0ff" cellspacing="0">
18 <th> <a
19 href="lxml-module.html">Home</a> </th>
22 <th> <a
23 href="module-tree.html">Trees</a> </th>
26 <th> <a
27 href="identifier-index.html">Indices</a> </th>
30 <th> <a
31 href="help.html">Help</a> </th>
33 <!-- Project homepage -->
34 <th class="navbar" align="right" width="100%">
35 <table border="0" cellpadding="0" cellspacing="0">
36 <tr><th class="navbar" align="center"
37 ><a class="navbar" target="_top" href="/">lxml API</a></th>
41 <table width="100%" cellpadding="0" cellspacing="0">
44 <span class="breadcrumbs">
48 Class XHTMLParser
52 <table cellpadding="0" cellspacing="0">
53 <!-- hide/show private -->
54 <tr><td align="right"><span class="options">[<a href="javascript:void(0);" class="privatelink"
55 onclick="toggle_private();">hide private</a>]</span></td></tr>
56 <tr><td align="right"><span class="options"
57 >[<a href="frames.html" target="_top">frames</a
58 >] | <a href="lxml.html.XHTMLParser-class.html"
59 target="_top">no frames</a>]</span></td></tr>
64 <!-- ==================== CLASS DESCRIPTION ==================== -->
65 <h1 class="epydoc">Class XHTMLParser</h1><p class="nomargin-top"><span class="codelink"><a href="lxml.html-pysrc.html#XHTMLParser">source code</a></span></p>
66 <pre class="base-tree">
71 <a href="lxml.etree._FeedParser-class.html" onclick="show_private();">etree._FeedParser</a> --+
73 <a href="lxml.etree.XMLParser-class.html">etree.XMLParser</a> --+
75 <strong class="uidshort">XHTMLParser</strong>
79 <p>An XML parser that is configured to return lxml.html Element
81 <p>Note that this parser is not really XHTML aware unless you let it
82 load a DTD that declares the HTML entities. To do this, make sure
83 you have the XHTML DTDs installed in your catalogs, and create the
85 <pre class="rst-literal-block">
86 >>> parser = XHTMLParser(load_dtd=True)
88 <p>If you additionally want to validate the document, use this:</p>
89 <pre class="rst-literal-block">
90 >>> parser = XHTMLParser(dtd_validation=True)
92 <p>For catalog support, see <a class="rst-reference external" href="http://www.xmlsoft.org/catalog.html" target="_top">http://www.xmlsoft.org/catalog.html</a>.</p>
94 <!-- ==================== INSTANCE METHODS ==================== -->
95 <a name="section-InstanceMethods"></a>
96 <table class="summary" border="1" cellpadding="3"
97 cellspacing="0" width="100%" bgcolor="white">
98 <tr bgcolor="#70b0f0" class="table-header">
99 <td colspan="2" class="table-header">
100 <table border="0" cellpadding="0" cellspacing="0" width="100%">
102 <td align="left"><span class="table-header">Instance Methods</span></td>
103 <td align="right" valign="top"
104 ><span class="options">[<a href="#section-InstanceMethods"
105 class="privatelink" onclick="toggle_private();"
106 >hide private</a>]</span></td>
112 <td width="15%" align="right" valign="top" class="summary">
113 <span class="summary-type"> </span>
114 </td><td class="summary">
115 <table width="100%" cellpadding="0" cellspacing="0" border="0">
117 <td><span class="summary-sig"><a href="lxml.html.XHTMLParser-class.html#__init__" class="summary-sig-name">__init__</a>(<span class="summary-sig-arg">self</span>,
118 <span class="summary-sig-arg">**kwargs</span>)</span><br />
119 x.__init__(...) initializes x; see help(type(x)) for signature</td>
120 <td align="right" valign="top">
121 <span class="codelink"><a href="lxml.html-pysrc.html#XHTMLParser.__init__">source code</a></span>
130 <td colspan="2" class="summary">
131 <p class="indent-wrapped-lines"><b>Inherited from <code><a href="lxml.etree.XMLParser-class.html">etree.XMLParser</a></code></b>:
132 <code><a href="lxml.etree.XMLParser-class.html#__new__">__new__</a></code>
134 <p class="indent-wrapped-lines"><b>Inherited from <code><a href="lxml.etree._FeedParser-class.html" onclick="show_private();">etree._FeedParser</a></code></b>:
135 <code><a href="lxml.etree._FeedParser-class.html#close">close</a></code>,
136 <code><a href="lxml.etree._FeedParser-class.html#feed">feed</a></code>
138 <p class="indent-wrapped-lines"><b>Inherited from <code><i>unreachable</i>._BaseParser</code></b>:
140 <code>makeelement</code>,
141 <code>setElementClassLookup</code>,
142 <code>set_element_class_lookup</code>
144 <p class="indent-wrapped-lines"><b>Inherited from <code>object</code></b>:
145 <code>__delattr__</code>,
146 <code>__format__</code>,
147 <code>__getattribute__</code>,
148 <code>__hash__</code>,
149 <code>__reduce__</code>,
150 <code>__reduce_ex__</code>,
151 <code>__repr__</code>,
152 <code>__setattr__</code>,
153 <code>__sizeof__</code>,
154 <code>__str__</code>,
155 <code>__subclasshook__</code>
160 <!-- ==================== PROPERTIES ==================== -->
161 <a name="section-Properties"></a>
162 <table class="summary" border="1" cellpadding="3"
163 cellspacing="0" width="100%" bgcolor="white">
164 <tr bgcolor="#70b0f0" class="table-header">
165 <td colspan="2" class="table-header">
166 <table border="0" cellpadding="0" cellspacing="0" width="100%">
168 <td align="left"><span class="table-header">Properties</span></td>
169 <td align="right" valign="top"
170 ><span class="options">[<a href="#section-Properties"
171 class="privatelink" onclick="toggle_private();"
172 >hide private</a>]</span></td>
178 <td colspan="2" class="summary">
179 <p class="indent-wrapped-lines"><b>Inherited from <code><a href="lxml.etree._FeedParser-class.html" onclick="show_private();">etree._FeedParser</a></code></b>:
180 <code><a href="lxml.etree._FeedParser-class.html#feed_error_log">feed_error_log</a></code>
182 <p class="indent-wrapped-lines"><b>Inherited from <code><i>unreachable</i>._BaseParser</code></b>:
183 <code>error_log</code>,
184 <code>resolvers</code>,
188 <p class="indent-wrapped-lines"><b>Inherited from <code>object</code></b>:
189 <code>__class__</code>
194 <!-- ==================== METHOD DETAILS ==================== -->
195 <a name="section-MethodDetails"></a>
196 <table class="details" border="1" cellpadding="3"
197 cellspacing="0" width="100%" bgcolor="white">
198 <tr bgcolor="#70b0f0" class="table-header">
199 <td colspan="2" class="table-header">
200 <table border="0" cellpadding="0" cellspacing="0" width="100%">
202 <td align="left"><span class="table-header">Method Details</span></td>
203 <td align="right" valign="top"
204 ><span class="options">[<a href="#section-MethodDetails"
205 class="privatelink" onclick="toggle_private();"
206 >hide private</a>]</span></td>
212 <a name="__init__"></a>
214 <table class="details" border="1" cellpadding="3"
215 cellspacing="0" width="100%" bgcolor="white">
217 <table width="100%" cellpadding="0" cellspacing="0" border="0">
218 <tr valign="top"><td>
219 <h3 class="epydoc"><span class="sig"><span class="sig-name">__init__</span>(<span class="sig-arg">self</span>,
220 <span class="sig-arg">**kwargs</span>)</span>
221 <br /><em class="fname">(Constructor)</em>
223 </td><td align="right" valign="top"
224 ><span class="codelink"><a href="lxml.html-pysrc.html#XHTMLParser.__init__">source code</a></span>
228 x.__init__(...) initializes x; see help(type(x)) for signature
232 <dd><em class="note">(inherited documentation)</em></dd>
238 <!-- ==================== NAVIGATION BAR ==================== -->
239 <table class="navbar" border="0" width="100%" cellpadding="0"
240 bgcolor="#a0c0ff" cellspacing="0">
243 <th> <a
244 href="lxml-module.html">Home</a> </th>
247 <th> <a
248 href="module-tree.html">Trees</a> </th>
251 <th> <a
252 href="identifier-index.html">Indices</a> </th>
255 <th> <a
256 href="help.html">Help</a> </th>
258 <!-- Project homepage -->
259 <th class="navbar" align="right" width="100%">
260 <table border="0" cellpadding="0" cellspacing="0">
261 <tr><th class="navbar" align="center"
262 ><a class="navbar" target="_top" href="/">lxml API</a></th>
266 <table border="0" cellpadding="0" cellspacing="0" width="100%%">
268 <td align="left" class="footer">
269 Generated by Epydoc 3.0.1
270 on Wed Jan 29 12:26:21 2020
272 <td align="right" class="footer">
273 <a target="mainFrame" href="http://epydoc.sourceforge.net"
274 >http://epydoc.sourceforge.net</a>
279 <script type="text/javascript">
281 // Private objects are initially displayed (because if
282 // javascript is turned off then we want them to be
283 // visible); but by default, we want to hide them. So hide
284 // them unless we have a cookie that says to show them.