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.etree.XSLTExtension</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">
45 <a href="lxml-module.html">Package lxml</a> ::
46 <a href="lxml.etree-module.html">Module etree</a> ::
47 Class XSLTExtension
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 private</a>]</span></td></tr>
55 <tr><td align="right"><span class="options"
56 >[<a href="frames.html" target="_top">frames</a
57 >] | <a href="lxml.etree.XSLTExtension-class.html"
58 target="_top">no frames</a>]</span></td></tr>
63 <!-- ==================== CLASS DESCRIPTION ==================== -->
64 <h1 class="epydoc">Class XSLTExtension</h1><p class="nomargin-top"></p>
65 <pre class="base-tree">
68 <strong class="uidshort">XSLTExtension</strong>
72 Base class of an XSLT extension element.
74 <!-- ==================== INSTANCE METHODS ==================== -->
75 <a name="section-InstanceMethods"></a>
76 <table class="summary" border="1" cellpadding="3"
77 cellspacing="0" width="100%" bgcolor="white">
78 <tr bgcolor="#70b0f0" class="table-header">
79 <td colspan="2" class="table-header">
80 <table border="0" cellpadding="0" cellspacing="0" width="100%">
82 <td align="left"><span class="table-header">Instance Methods</span></td>
83 <td align="right" valign="top"
84 ><span class="options">[<a href="#section-InstanceMethods"
85 class="privatelink" onclick="toggle_private();"
86 >hide private</a>]</span></td>
92 <td width="15%" align="right" valign="top" class="summary">
93 <span class="summary-type">a new object with type S, a subtype of T</span>
94 </td><td class="summary">
95 <table width="100%" cellpadding="0" cellspacing="0" border="0">
97 <td><span class="summary-sig"><a href="lxml.etree.XSLTExtension-class.html#__new__" class="summary-sig-name">__new__</a>(<span class="summary-sig-arg">T</span>,
98 <span class="summary-sig-arg">S</span>,
99 <span class="summary-sig-arg">...</span>)</span></td>
100 <td align="right" valign="top">
110 <td width="15%" align="right" valign="top" class="summary">
111 <span class="summary-type"> </span>
112 </td><td class="summary">
113 <table width="100%" cellpadding="0" cellspacing="0" border="0">
115 <td><span class="summary-sig"><a href="lxml.etree.XSLTExtension-class.html#apply_templates" class="summary-sig-name">apply_templates</a>(<span class="summary-sig-arg">self</span>,
116 <span class="summary-sig-arg">context</span>,
117 <span class="summary-sig-arg">node</span>,
118 <span class="summary-sig-arg">output_parent</span>=<span class="summary-sig-default">None</span>)</span><br />
119 Call this method to retrieve the result of applying templates
121 <td align="right" valign="top">
131 <td width="15%" align="right" valign="top" class="summary">
132 <span class="summary-type"> </span>
133 </td><td class="summary">
134 <table width="100%" cellpadding="0" cellspacing="0" border="0">
136 <td><span class="summary-sig"><a href="lxml.etree.XSLTExtension-class.html#execute" class="summary-sig-name">execute</a>(<span class="summary-sig-arg">self</span>,
137 <span class="summary-sig-arg">context</span>,
138 <span class="summary-sig-arg">self_node</span>,
139 <span class="summary-sig-arg">input_node</span>,
140 <span class="summary-sig-arg">output_parent</span>)</span><br />
141 Execute this extension element.</td>
142 <td align="right" valign="top">
152 <td width="15%" align="right" valign="top" class="summary">
153 <span class="summary-type"> </span>
154 </td><td class="summary">
155 <table width="100%" cellpadding="0" cellspacing="0" border="0">
157 <td><span class="summary-sig"><a href="lxml.etree.XSLTExtension-class.html#process_children" class="summary-sig-name">process_children</a>(<span class="summary-sig-arg">self</span>,
158 <span class="summary-sig-arg">context</span>,
159 <span class="summary-sig-arg">output_parent</span>=<span class="summary-sig-default">None</span>)</span><br />
160 Call this method to process the XSLT content of the extension
162 <td align="right" valign="top">
172 <td colspan="2" class="summary">
173 <p class="indent-wrapped-lines"><b>Inherited from <code>object</code></b>:
174 <code>__delattr__</code>,
175 <code>__format__</code>,
176 <code>__getattribute__</code>,
177 <code>__hash__</code>,
178 <code>__init__</code>,
179 <code>__reduce__</code>,
180 <code>__reduce_ex__</code>,
181 <code>__repr__</code>,
182 <code>__setattr__</code>,
183 <code>__sizeof__</code>,
184 <code>__str__</code>,
185 <code>__subclasshook__</code>
190 <!-- ==================== PROPERTIES ==================== -->
191 <a name="section-Properties"></a>
192 <table class="summary" border="1" cellpadding="3"
193 cellspacing="0" width="100%" bgcolor="white">
194 <tr bgcolor="#70b0f0" class="table-header">
195 <td colspan="2" class="table-header">
196 <table border="0" cellpadding="0" cellspacing="0" width="100%">
198 <td align="left"><span class="table-header">Properties</span></td>
199 <td align="right" valign="top"
200 ><span class="options">[<a href="#section-Properties"
201 class="privatelink" onclick="toggle_private();"
202 >hide private</a>]</span></td>
208 <td colspan="2" class="summary">
209 <p class="indent-wrapped-lines"><b>Inherited from <code>object</code></b>:
210 <code>__class__</code>
215 <!-- ==================== METHOD DETAILS ==================== -->
216 <a name="section-MethodDetails"></a>
217 <table class="details" border="1" cellpadding="3"
218 cellspacing="0" width="100%" bgcolor="white">
219 <tr bgcolor="#70b0f0" class="table-header">
220 <td colspan="2" class="table-header">
221 <table border="0" cellpadding="0" cellspacing="0" width="100%">
223 <td align="left"><span class="table-header">Method Details</span></td>
224 <td align="right" valign="top"
225 ><span class="options">[<a href="#section-MethodDetails"
226 class="privatelink" onclick="toggle_private();"
227 >hide private</a>]</span></td>
233 <a name="__new__"></a>
235 <table class="details" border="1" cellpadding="3"
236 cellspacing="0" width="100%" bgcolor="white">
238 <table width="100%" cellpadding="0" cellspacing="0" border="0">
239 <tr valign="top"><td>
240 <h3 class="epydoc"><span class="sig"><span class="sig-name">__new__</span>(<span class="sig-arg">T</span>,
241 <span class="sig-arg">S</span>,
242 <span class="sig-arg">...</span>)</span>
244 </td><td align="right" valign="top"
251 <dt>Returns: a new object with type S, a subtype of T</dt>
258 <a name="apply_templates"></a>
260 <table class="details" border="1" cellpadding="3"
261 cellspacing="0" width="100%" bgcolor="white">
263 <table width="100%" cellpadding="0" cellspacing="0" border="0">
264 <tr valign="top"><td>
265 <h3 class="epydoc"><span class="sig"><span class="sig-name">apply_templates</span>(<span class="sig-arg">self</span>,
266 <span class="sig-arg">context</span>,
267 <span class="sig-arg">node</span>,
268 <span class="sig-arg">output_parent</span>=<span class="sig-default">None</span>)</span>
270 </td><td align="right" valign="top"
275 <p>Call this method to retrieve the result of applying templates
277 <p>The return value is a list of elements or text strings that
278 were generated by the XSLT processor.</p>
279 <p>If you pass an Element as <code class="link">output_parent</code> parameter, the result
280 will instead be appended to the element (including attributes
281 etc.) and the return value will be <code class="link">None</code>. This is a safe way
282 to generate content into the output document directly, without
283 having to take care of special values like text or attributes.</p>
288 <a name="execute"></a>
290 <table class="details" border="1" cellpadding="3"
291 cellspacing="0" width="100%" bgcolor="white">
293 <table width="100%" cellpadding="0" cellspacing="0" border="0">
294 <tr valign="top"><td>
295 <h3 class="epydoc"><span class="sig"><span class="sig-name">execute</span>(<span class="sig-arg">self</span>,
296 <span class="sig-arg">context</span>,
297 <span class="sig-arg">self_node</span>,
298 <span class="sig-arg">input_node</span>,
299 <span class="sig-arg">output_parent</span>)</span>
301 </td><td align="right" valign="top"
306 <p>Execute this extension element.</p>
307 <p>Subclasses must override this method. They may append
308 elements to the <code class="link">output_parent</code> element here, or set its text
309 content. To this end, the <code class="link">input_node</code> provides read-only
310 access to the current node in the input document, and the
311 <code class="link">self_node</code> points to the extension element in the stylesheet.</p>
312 <p>Note that the <code class="link">output_parent</code> parameter may be <code class="link">None</code> if there
313 is no parent element in the current context (e.g. no content
314 was added to the output tree yet).</p>
319 <a name="process_children"></a>
321 <table class="details" border="1" cellpadding="3"
322 cellspacing="0" width="100%" bgcolor="white">
324 <table width="100%" cellpadding="0" cellspacing="0" border="0">
325 <tr valign="top"><td>
326 <h3 class="epydoc"><span class="sig"><span class="sig-name">process_children</span>(<span class="sig-arg">self</span>,
327 <span class="sig-arg">context</span>,
328 <span class="sig-arg">output_parent</span>=<span class="sig-default">None</span>)</span>
330 </td><td align="right" valign="top"
335 <p>Call this method to process the XSLT content of the extension
337 <p>The return value is a list of elements or text strings that
338 were generated by the XSLT processor.</p>
339 <p>If you pass an Element as <code class="link">output_parent</code> parameter, the result
340 will instead be appended to the element (including attributes
341 etc.) and the return value will be <code class="link">None</code>. This is a safe way
342 to generate content into the output document directly, without
343 having to take care of special values like text or attributes.</p>
349 <!-- ==================== NAVIGATION BAR ==================== -->
350 <table class="navbar" border="0" width="100%" cellpadding="0"
351 bgcolor="#a0c0ff" cellspacing="0">
354 <th> <a
355 href="lxml-module.html">Home</a> </th>
358 <th> <a
359 href="module-tree.html">Trees</a> </th>
362 <th> <a
363 href="identifier-index.html">Indices</a> </th>
366 <th> <a
367 href="help.html">Help</a> </th>
369 <!-- Project homepage -->
370 <th class="navbar" align="right" width="100%">
371 <table border="0" cellpadding="0" cellspacing="0">
372 <tr><th class="navbar" align="center"
373 ><a class="navbar" target="_top" href="/">lxml API</a></th>
377 <table border="0" cellpadding="0" cellspacing="0" width="100%%">
379 <td align="left" class="footer">
380 Generated by Epydoc 3.0.1 on Tue Jul 31 10:14:18 2012
382 <td align="right" class="footer">
383 <a target="mainFrame" href="http://epydoc.sourceforge.net"
384 >http://epydoc.sourceforge.net</a>
389 <script type="text/javascript">
391 // Private objects are initially displayed (because if
392 // javascript is turned off then we want them to be
393 // visible); but by default, we want to hide them. So hide
394 // them unless we have a cookie that says to show them.