Imported Upstream version 4.5.2
[platform/upstream/python-lxml.git] / doc / html / api / lxml.etree.CustomElementClassLookup-class.html
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">
5 <head>
6   <title>lxml.etree.CustomElementClassLookup</title>
7   <link rel="stylesheet" href="epydoc.css" type="text/css" />
8   <script type="text/javascript" src="epydoc.js"></script>
9 </head>
10
11 <body bgcolor="white" text="black" link="blue" vlink="#204080"
12       alink="#204080">
13 <!-- ==================== NAVIGATION BAR ==================== -->
14 <table class="navbar" border="0" width="100%" cellpadding="0"
15        bgcolor="#a0c0ff" cellspacing="0">
16   <tr valign="middle">
17   <!-- Home link -->
18       <th>&nbsp;&nbsp;&nbsp;<a
19         href="lxml-module.html">Home</a>&nbsp;&nbsp;&nbsp;</th>
20
21   <!-- Tree link -->
22       <th>&nbsp;&nbsp;&nbsp;<a
23         href="module-tree.html">Trees</a>&nbsp;&nbsp;&nbsp;</th>
24
25   <!-- Index link -->
26       <th>&nbsp;&nbsp;&nbsp;<a
27         href="identifier-index.html">Indices</a>&nbsp;&nbsp;&nbsp;</th>
28
29   <!-- Help link -->
30       <th>&nbsp;&nbsp;&nbsp;<a
31         href="help.html">Help</a>&nbsp;&nbsp;&nbsp;</th>
32
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>
38           </tr></table></th>
39   </tr>
40 </table>
41 <table width="100%" cellpadding="0" cellspacing="0">
42   <tr valign="top">
43     <td width="100%">
44       <span class="breadcrumbs">
45         <a href="lxml-module.html">Package&nbsp;lxml</a> ::
46         <a href="lxml.etree-module.html">Module&nbsp;etree</a> ::
47         Class&nbsp;CustomElementClassLookup
48       </span>
49     </td>
50     <td>
51       <table cellpadding="0" cellspacing="0">
52         <!-- hide/show private -->
53         <tr><td align="right"><span class="options">[<a href="javascript:void(0);" class="privatelink"
54     onclick="toggle_private();">hide&nbsp;private</a>]</span></td></tr>
55         <tr><td align="right"><span class="options"
56             >[<a href="frames.html" target="_top">frames</a
57             >]&nbsp;|&nbsp;<a href="lxml.etree.CustomElementClassLookup-class.html"
58             target="_top">no&nbsp;frames</a>]</span></td></tr>
59       </table>
60     </td>
61   </tr>
62 </table>
63 <!-- ==================== CLASS DESCRIPTION ==================== -->
64 <h1 class="epydoc">Class CustomElementClassLookup</h1><p class="nomargin-top"></p>
65 <pre class="base-tree">
66             object --+        
67                      |        
68     <a href="lxml.etree.ElementClassLookup-class.html">ElementClassLookup</a> --+    
69                          |    
70 <a href="lxml.etree.FallbackElementClassLookup-class.html">FallbackElementClassLookup</a> --+
71                              |
72                             <strong class="uidshort">CustomElementClassLookup</strong>
73 </pre>
74
75 <dl><dt>Known Subclasses:</dt>
76 <dd>
77       <ul class="subclass-list">
78 <li><a href="lxml.html.HtmlElementClassLookup-class.html">html.HtmlElementClassLookup</a></li>  </ul>
79 </dd></dl>
80
81 <hr />
82 <p>CustomElementClassLookup(self, fallback=None)
83 Element class lookup based on a subclass method.</p>
84 <p>You can inherit from this class and override the method:</p>
85 <pre class="rst-literal-block">
86 lookup(self, type, doc, namespace, name)
87 </pre>
88 <p>to lookup the element class for a node. Arguments of the method:
89 * type:      one of 'element', 'comment', 'PI', 'entity'
90 * doc:       document that the node is in
91 * namespace: namespace URI of the node (or None for comments/PIs/entities)
92 * name:      name of the element/entity, None for comments, target for PIs</p>
93 <p>If you return None from this method, the fallback will be called.</p>
94
95 <!-- ==================== INSTANCE METHODS ==================== -->
96 <a name="section-InstanceMethods"></a>
97 <table class="summary" border="1" cellpadding="3"
98        cellspacing="0" width="100%" bgcolor="white">
99 <tr bgcolor="#70b0f0" class="table-header">
100   <td colspan="2" class="table-header">
101     <table border="0" cellpadding="0" cellspacing="0" width="100%">
102       <tr valign="top">
103         <td align="left"><span class="table-header">Instance Methods</span></td>
104         <td align="right" valign="top"
105          ><span class="options">[<a href="#section-InstanceMethods"
106          class="privatelink" onclick="toggle_private();"
107          >hide private</a>]</span></td>
108       </tr>
109     </table>
110   </td>
111 </tr>
112 <tr>
113     <td width="15%" align="right" valign="top" class="summary">
114       <span class="summary-type">a new object with type S, a subtype of T</span>
115     </td><td class="summary">
116       <table width="100%" cellpadding="0" cellspacing="0" border="0">
117         <tr>
118           <td><span class="summary-sig"><a href="lxml.etree.CustomElementClassLookup-class.html#__new__" class="summary-sig-name">__new__</a>(<span class="summary-sig-arg">T</span>,
119         <span class="summary-sig-arg">S</span>,
120         <span class="summary-sig-arg">...</span>)</span></td>
121           <td align="right" valign="top">
122             
123             
124           </td>
125         </tr>
126       </table>
127       
128     </td>
129   </tr>
130 <tr>
131     <td width="15%" align="right" valign="top" class="summary">
132       <span class="summary-type">&nbsp;</span>
133     </td><td class="summary">
134       <table width="100%" cellpadding="0" cellspacing="0" border="0">
135         <tr>
136           <td><span class="summary-sig"><a name="lookup"></a><span class="summary-sig-name">lookup</span>(<span class="summary-sig-arg">self</span>,
137         <span class="summary-sig-arg">type</span>,
138         <span class="summary-sig-arg">doc</span>,
139         <span class="summary-sig-arg">namespace</span>,
140         <span class="summary-sig-arg">name</span>)</span></td>
141           <td align="right" valign="top">
142             
143             
144           </td>
145         </tr>
146       </table>
147       
148     </td>
149   </tr>
150   <tr>
151     <td colspan="2" class="summary">
152     <p class="indent-wrapped-lines"><b>Inherited from <code><a href="lxml.etree.FallbackElementClassLookup-class.html">FallbackElementClassLookup</a></code></b>:
153       <code><a href="lxml.etree.FallbackElementClassLookup-class.html#__init__">__init__</a></code>,
154       <code><a href="lxml.etree.FallbackElementClassLookup-class.html#set_fallback">set_fallback</a></code>
155       </p>
156     <p class="indent-wrapped-lines"><b>Inherited from <code>object</code></b>:
157       <code>__delattr__</code>,
158       <code>__format__</code>,
159       <code>__getattribute__</code>,
160       <code>__hash__</code>,
161       <code>__reduce__</code>,
162       <code>__reduce_ex__</code>,
163       <code>__repr__</code>,
164       <code>__setattr__</code>,
165       <code>__sizeof__</code>,
166       <code>__str__</code>,
167       <code>__subclasshook__</code>
168       </p>
169     </td>
170   </tr>
171 </table>
172 <!-- ==================== PROPERTIES ==================== -->
173 <a name="section-Properties"></a>
174 <table class="summary" border="1" cellpadding="3"
175        cellspacing="0" width="100%" bgcolor="white">
176 <tr bgcolor="#70b0f0" class="table-header">
177   <td colspan="2" class="table-header">
178     <table border="0" cellpadding="0" cellspacing="0" width="100%">
179       <tr valign="top">
180         <td align="left"><span class="table-header">Properties</span></td>
181         <td align="right" valign="top"
182          ><span class="options">[<a href="#section-Properties"
183          class="privatelink" onclick="toggle_private();"
184          >hide private</a>]</span></td>
185       </tr>
186     </table>
187   </td>
188 </tr>
189   <tr>
190     <td colspan="2" class="summary">
191     <p class="indent-wrapped-lines"><b>Inherited from <code><a href="lxml.etree.FallbackElementClassLookup-class.html">FallbackElementClassLookup</a></code></b>:
192       <code><a href="lxml.etree.FallbackElementClassLookup-class.html#fallback">fallback</a></code>
193       </p>
194     <p class="indent-wrapped-lines"><b>Inherited from <code>object</code></b>:
195       <code>__class__</code>
196       </p>
197     </td>
198   </tr>
199 </table>
200 <!-- ==================== METHOD DETAILS ==================== -->
201 <a name="section-MethodDetails"></a>
202 <table class="details" border="1" cellpadding="3"
203        cellspacing="0" width="100%" bgcolor="white">
204 <tr bgcolor="#70b0f0" class="table-header">
205   <td colspan="2" class="table-header">
206     <table border="0" cellpadding="0" cellspacing="0" width="100%">
207       <tr valign="top">
208         <td align="left"><span class="table-header">Method Details</span></td>
209         <td align="right" valign="top"
210          ><span class="options">[<a href="#section-MethodDetails"
211          class="privatelink" onclick="toggle_private();"
212          >hide private</a>]</span></td>
213       </tr>
214     </table>
215   </td>
216 </tr>
217 </table>
218 <a name="__new__"></a>
219 <div>
220 <table class="details" border="1" cellpadding="3"
221        cellspacing="0" width="100%" bgcolor="white">
222 <tr><td>
223   <table width="100%" cellpadding="0" cellspacing="0" border="0">
224   <tr valign="top"><td>
225   <h3 class="epydoc"><span class="sig"><span class="sig-name">__new__</span>(<span class="sig-arg">T</span>,
226         <span class="sig-arg">S</span>,
227         <span class="sig-arg">...</span>)</span>
228   </h3>
229   </td><td align="right" valign="top"
230     >&nbsp;
231     </td>
232   </tr></table>
233   
234   
235   <dl class="fields">
236     <dt>Returns: a new object with type S, a subtype of T</dt>
237     <dt>Overrides:
238         object.__new__
239     </dt>
240   </dl>
241 </td></tr></table>
242 </div>
243 <br />
244 <!-- ==================== NAVIGATION BAR ==================== -->
245 <table class="navbar" border="0" width="100%" cellpadding="0"
246        bgcolor="#a0c0ff" cellspacing="0">
247   <tr valign="middle">
248   <!-- Home link -->
249       <th>&nbsp;&nbsp;&nbsp;<a
250         href="lxml-module.html">Home</a>&nbsp;&nbsp;&nbsp;</th>
251
252   <!-- Tree link -->
253       <th>&nbsp;&nbsp;&nbsp;<a
254         href="module-tree.html">Trees</a>&nbsp;&nbsp;&nbsp;</th>
255
256   <!-- Index link -->
257       <th>&nbsp;&nbsp;&nbsp;<a
258         href="identifier-index.html">Indices</a>&nbsp;&nbsp;&nbsp;</th>
259
260   <!-- Help link -->
261       <th>&nbsp;&nbsp;&nbsp;<a
262         href="help.html">Help</a>&nbsp;&nbsp;&nbsp;</th>
263
264   <!-- Project homepage -->
265       <th class="navbar" align="right" width="100%">
266         <table border="0" cellpadding="0" cellspacing="0">
267           <tr><th class="navbar" align="center"
268             ><a class="navbar" target="_top" href="/">lxml API</a></th>
269           </tr></table></th>
270   </tr>
271 </table>
272 <table border="0" cellpadding="0" cellspacing="0" width="100%%">
273   <tr>
274     <td align="left" class="footer">
275     Generated by Epydoc 3.0.1
276     on Thu Jul  9 18:29:53 2020
277     </td>
278     <td align="right" class="footer">
279       <a target="mainFrame" href="http://epydoc.sourceforge.net"
280         >http://epydoc.sourceforge.net</a>
281     </td>
282   </tr>
283 </table>
284
285 <script type="text/javascript">
286   <!--
287   // Private objects are initially displayed (because if
288   // javascript is turned off then we want them to be
289   // visible); but by default, we want to hide them.  So hide
290   // them unless we have a cookie that says to show them.
291   checkCookie();
292   // -->
293 </script>
294 </body>
295 </html>