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.RelaxNG</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> ::
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.RelaxNG-class.html"
58 target="_top">no frames</a>]</span></td></tr>
63 <!-- ==================== CLASS DESCRIPTION ==================== -->
64 <h1 class="epydoc">Class RelaxNG</h1><p class="nomargin-top"></p>
65 <pre class="base-tree">
68 <a href="lxml.etree._Validator-class.html" onclick="show_private();">_Validator</a> --+
70 <strong class="uidshort">RelaxNG</strong>
74 <p>RelaxNG(self, etree=None, file=None)
75 Turn a document into a Relax NG validator.</p>
76 <p>Either pass a schema as Element or ElementTree, or pass a file or
77 filename through the <tt class="rst-docutils literal">file</tt> keyword argument.</p>
79 <!-- ==================== INSTANCE METHODS ==================== -->
80 <a name="section-InstanceMethods"></a>
81 <table class="summary" border="1" cellpadding="3"
82 cellspacing="0" width="100%" bgcolor="white">
83 <tr bgcolor="#70b0f0" class="table-header">
84 <td colspan="2" class="table-header">
85 <table border="0" cellpadding="0" cellspacing="0" width="100%">
87 <td align="left"><span class="table-header">Instance Methods</span></td>
88 <td align="right" valign="top"
89 ><span class="options">[<a href="#section-InstanceMethods"
90 class="privatelink" onclick="toggle_private();"
91 >hide private</a>]</span></td>
97 <td width="15%" align="right" valign="top" class="summary">
98 <span class="summary-type"> </span>
99 </td><td class="summary">
100 <table width="100%" cellpadding="0" cellspacing="0" border="0">
102 <td><span class="summary-sig"><a href="lxml.etree.RelaxNG-class.html#__call__" class="summary-sig-name">__call__</a>(<span class="summary-sig-arg">self</span>,
103 <span class="summary-sig-arg">etree</span>)</span><br />
104 Validate doc using Relax NG.</td>
105 <td align="right" valign="top">
115 <td width="15%" align="right" valign="top" class="summary">
116 <span class="summary-type"> </span>
117 </td><td class="summary">
118 <table width="100%" cellpadding="0" cellspacing="0" border="0">
120 <td><span class="summary-sig"><a href="lxml.etree.RelaxNG-class.html#__init__" class="summary-sig-name">__init__</a>(<span class="summary-sig-arg">self</span>,
121 <span class="summary-sig-arg">etree</span>=<span class="summary-sig-default">None</span>,
122 <span class="summary-sig-arg">file</span>=<span class="summary-sig-default">None</span>)</span><br />
123 x.__init__(...) initializes x; see help(type(x)) for signature</td>
124 <td align="right" valign="top">
134 <td width="15%" align="right" valign="top" class="summary">
135 <span class="summary-type">a new object with type S, a subtype of T</span>
136 </td><td class="summary">
137 <table width="100%" cellpadding="0" cellspacing="0" border="0">
139 <td><span class="summary-sig"><a href="lxml.etree.RelaxNG-class.html#__new__" class="summary-sig-name">__new__</a>(<span class="summary-sig-arg">T</span>,
140 <span class="summary-sig-arg">S</span>,
141 <span class="summary-sig-arg">...</span>)</span></td>
142 <td align="right" valign="top">
152 <td colspan="2" class="summary">
153 <p class="indent-wrapped-lines"><b>Inherited from <code><a href="lxml.etree._Validator-class.html" onclick="show_private();">_Validator</a></code></b>:
154 <code><a href="lxml.etree._Validator-class.html#assertValid">assertValid</a></code>,
155 <code><a href="lxml.etree._Validator-class.html#assert_">assert_</a></code>,
156 <code><a href="lxml.etree._Validator-class.html#validate">validate</a></code>
158 <div class="private"> <p class="indent-wrapped-lines"><b>Inherited from <code><a href="lxml.etree._Validator-class.html" onclick="show_private();">_Validator</a></code></b> (private):
159 <code><a href="lxml.etree._Validator-class.html#_append_log_message" onclick="show_private();">_append_log_message</a></code>,
160 <code><a href="lxml.etree._Validator-class.html#_clear_error_log" onclick="show_private();">_clear_error_log</a></code>
162 <p class="indent-wrapped-lines"><b>Inherited from <code>object</code></b>:
163 <code>__delattr__</code>,
164 <code>__format__</code>,
165 <code>__getattribute__</code>,
166 <code>__hash__</code>,
167 <code>__reduce__</code>,
168 <code>__reduce_ex__</code>,
169 <code>__repr__</code>,
170 <code>__setattr__</code>,
171 <code>__sizeof__</code>,
172 <code>__str__</code>,
173 <code>__subclasshook__</code>
178 <!-- ==================== CLASS METHODS ==================== -->
179 <a name="section-ClassMethods"></a>
180 <table class="summary" border="1" cellpadding="3"
181 cellspacing="0" width="100%" bgcolor="white">
182 <tr bgcolor="#70b0f0" class="table-header">
183 <td colspan="2" class="table-header">
184 <table border="0" cellpadding="0" cellspacing="0" width="100%">
186 <td align="left"><span class="table-header">Class Methods</span></td>
187 <td align="right" valign="top"
188 ><span class="options">[<a href="#section-ClassMethods"
189 class="privatelink" onclick="toggle_private();"
190 >hide private</a>]</span></td>
196 <td width="15%" align="right" valign="top" class="summary">
197 <span class="summary-type"> </span>
198 </td><td class="summary">
199 <table width="100%" cellpadding="0" cellspacing="0" border="0">
201 <td><span class="summary-sig"><a href="lxml.etree.RelaxNG-class.html#from_rnc_string" class="summary-sig-name">from_rnc_string</a>(<span class="summary-sig-arg">...</span>)</span><br />
202 Parse a RelaxNG schema in compact syntax from a text string</td>
203 <td align="right" valign="top">
213 <!-- ==================== PROPERTIES ==================== -->
214 <a name="section-Properties"></a>
215 <table class="summary" border="1" cellpadding="3"
216 cellspacing="0" width="100%" bgcolor="white">
217 <tr bgcolor="#70b0f0" class="table-header">
218 <td colspan="2" class="table-header">
219 <table border="0" cellpadding="0" cellspacing="0" width="100%">
221 <td align="left"><span class="table-header">Properties</span></td>
222 <td align="right" valign="top"
223 ><span class="options">[<a href="#section-Properties"
224 class="privatelink" onclick="toggle_private();"
225 >hide private</a>]</span></td>
231 <td colspan="2" class="summary">
232 <p class="indent-wrapped-lines"><b>Inherited from <code><a href="lxml.etree._Validator-class.html" onclick="show_private();">_Validator</a></code></b>:
233 <code><a href="lxml.etree._Validator-class.html#error_log">error_log</a></code>
235 <p class="indent-wrapped-lines"><b>Inherited from <code>object</code></b>:
236 <code>__class__</code>
241 <!-- ==================== METHOD DETAILS ==================== -->
242 <a name="section-MethodDetails"></a>
243 <table class="details" border="1" cellpadding="3"
244 cellspacing="0" width="100%" bgcolor="white">
245 <tr bgcolor="#70b0f0" class="table-header">
246 <td colspan="2" class="table-header">
247 <table border="0" cellpadding="0" cellspacing="0" width="100%">
249 <td align="left"><span class="table-header">Method Details</span></td>
250 <td align="right" valign="top"
251 ><span class="options">[<a href="#section-MethodDetails"
252 class="privatelink" onclick="toggle_private();"
253 >hide private</a>]</span></td>
259 <a name="__call__"></a>
261 <table class="details" border="1" cellpadding="3"
262 cellspacing="0" width="100%" bgcolor="white">
264 <table width="100%" cellpadding="0" cellspacing="0" border="0">
265 <tr valign="top"><td>
266 <h3 class="epydoc"><span class="sig"><span class="sig-name">__call__</span>(<span class="sig-arg">self</span>,
267 <span class="sig-arg">etree</span>)</span>
268 <br /><em class="fname">(Call operator)</em>
270 </td><td align="right" valign="top"
275 <p>Validate doc using Relax NG.</p>
276 <p>Returns true if document is valid, false if not.</p>
281 <a name="__init__"></a>
283 <table class="details" border="1" cellpadding="3"
284 cellspacing="0" width="100%" bgcolor="white">
286 <table width="100%" cellpadding="0" cellspacing="0" border="0">
287 <tr valign="top"><td>
288 <h3 class="epydoc"><span class="sig"><span class="sig-name">__init__</span>(<span class="sig-arg">self</span>,
289 <span class="sig-arg">etree</span>=<span class="sig-default">None</span>,
290 <span class="sig-arg">file</span>=<span class="sig-default">None</span>)</span>
291 <br /><em class="fname">(Constructor)</em>
293 </td><td align="right" valign="top"
298 x.__init__(...) initializes x; see help(type(x)) for signature
306 <a name="__new__"></a>
308 <table class="details" border="1" cellpadding="3"
309 cellspacing="0" width="100%" bgcolor="white">
311 <table width="100%" cellpadding="0" cellspacing="0" border="0">
312 <tr valign="top"><td>
313 <h3 class="epydoc"><span class="sig"><span class="sig-name">__new__</span>(<span class="sig-arg">T</span>,
314 <span class="sig-arg">S</span>,
315 <span class="sig-arg">...</span>)</span>
317 </td><td align="right" valign="top"
324 <dt>Returns: a new object with type S, a subtype of T</dt>
331 <a name="from_rnc_string"></a>
333 <table class="details" border="1" cellpadding="3"
334 cellspacing="0" width="100%" bgcolor="white">
336 <table width="100%" cellpadding="0" cellspacing="0" border="0">
337 <tr valign="top"><td>
338 <h3 class="epydoc"><span class="sig"><span class="sig-name">from_rnc_string</span>(<span class="sig-arg">...</span>)</span>
339 <br /><em class="fname">Class Method</em>
341 </td><td align="right" valign="top"
346 <p>Parse a RelaxNG schema in compact syntax from a text string</p>
347 <p>Requires the rnc2rng package to be installed.</p>
348 <p>Passing the source URL or file path of the source as 'base_url'
349 will enable resolving resource references relative to the source.</p>
355 <!-- ==================== NAVIGATION BAR ==================== -->
356 <table class="navbar" border="0" width="100%" cellpadding="0"
357 bgcolor="#a0c0ff" cellspacing="0">
360 <th> <a
361 href="lxml-module.html">Home</a> </th>
364 <th> <a
365 href="module-tree.html">Trees</a> </th>
368 <th> <a
369 href="identifier-index.html">Indices</a> </th>
372 <th> <a
373 href="help.html">Help</a> </th>
375 <!-- Project homepage -->
376 <th class="navbar" align="right" width="100%">
377 <table border="0" cellpadding="0" cellspacing="0">
378 <tr><th class="navbar" align="center"
379 ><a class="navbar" target="_top" href="/">lxml API</a></th>
383 <table border="0" cellpadding="0" cellspacing="0" width="100%%">
385 <td align="left" class="footer">
386 Generated by Epydoc 3.0.1
387 on Wed Jan 29 12:26:21 2020
389 <td align="right" class="footer">
390 <a target="mainFrame" href="http://epydoc.sourceforge.net"
391 >http://epydoc.sourceforge.net</a>
396 <script type="text/javascript">
398 // Private objects are initially displayed (because if
399 // javascript is turned off then we want them to be
400 // visible); but by default, we want to hide them. So hide
401 // them unless we have a cookie that says to show them.