~ubuntu-branches/ubuntu/precise/python-qt4/precise-proposed

« back to all changes in this revision

Viewing changes to doc/html/qxmlschemavalidator.html

  • Committer: Bazaar Package Importer
  • Author(s): Jonathan Riddell, Jonathan Riddell
  • Date: 2010-11-08 16:13:33 UTC
  • mfrom: (1.5.5 upstream)
  • Revision ID: james.westby@ubuntu.com-20101108161333-0nec4wu0nz3wpf9r
Tags: 4.8.1-0ubuntu1
[ Jonathan Riddell ]
* New upstream release
* Build against python-sip-dev 4.11.2
* Remove kubuntu_02_fix-scpk-and-flag-issue.diff merged upstream
* Install __init__.py into /usr/lib/python3.2/dist-packages/PyQt4,
  fixes Python 3 support
* Add QtDeclarative to python-qt4
* Add kubuntu_03_uiparser.diff from upstream

Show diffs side-by-side

added added

removed removed

Lines of Context:
6
6
td.postheader { font-family: sans-serif }
7
7
tr.address { font-family: sans-serif }
8
8
body { background: #ffffff; color: black; }
9
 
</style></head><body><table border="0" cellpadding="0" cellspacing="0" width="100%"><tr /><td align="left" valign="top" width="32"><img align="left" border="0" height="32" src="images/rb-logo.png" width="32" /></td><td width="1">&#160;&#160;</td><td class="postheader" valign="center"><a href="../pyqt4ref.html"><font color="#004faf">Home</font></a>&#160;&#183; <a href="classes.html"><font color="#004faf">All Classes</font></a>&#160;&#183; <a href="modules.html"><font color="#004faf">Modules</font></a></td></table><h1 align="center">QXmlSchemaValidator Class Reference<br /><sup><sup>[<a href="qtxmlpatterns.html">QtXmlPatterns</a> module]</sup></sup></h1><p>The QXmlSchemaValidator class validates XML instance documents against a W3C XML Schema. <a href="#details">More...</a></p>
10
 
<h3>Methods</h3><ul><li><div class="fn" /><b><a href="qxmlschemavalidator.html#QXmlSchemaValidator">__init__</a></b> (<i>self</i>)</li><li><div class="fn" /><b><a href="qxmlschemavalidator.html#QXmlSchemaValidator-2">__init__</a></b> (<i>self</i>, QXmlSchema)</li><li><div class="fn" />QAbstractMessageHandler <b><a href="qxmlschemavalidator.html#messageHandler">messageHandler</a></b> (<i>self</i>)</li><li><div class="fn" />QXmlNamePool <b><a href="qxmlschemavalidator.html#namePool">namePool</a></b> (<i>self</i>)</li><li><div class="fn" />QNetworkAccessManager <b><a href="qxmlschemavalidator.html#networkAccessManager">networkAccessManager</a></b> (<i>self</i>)</li><li><div class="fn" />QXmlSchema <b><a href="qxmlschemavalidator.html#schema">schema</a></b> (<i>self</i>)</li><li><div class="fn" /><b><a href="qxmlschemavalidator.html#setMessageHandler">setMessageHandler</a></b> (<i>self</i>, QAbstractMessageHandler)</li><li><div class="fn" /><b><a href="qxmlschemavalidator.html#setNetworkAccessManager">setNetworkAccessManager</a></b> (<i>self</i>, QNetworkAccessManager)</li><li><div class="fn" /><b><a href="qxmlschemavalidator.html#setSchema">setSchema</a></b> (<i>self</i>, QXmlSchema)</li><li><div class="fn" /><b><a href="qxmlschemavalidator.html#setUriResolver">setUriResolver</a></b> (<i>self</i>, QAbstractUriResolver)</li><li><div class="fn" />QAbstractUriResolver <b><a href="qxmlschemavalidator.html#uriResolver">uriResolver</a></b> (<i>self</i>)</li><li><div class="fn" />bool <b><a href="qxmlschemavalidator.html#validate">validate</a></b> (<i>self</i>, QUrl)</li><li><div class="fn" />bool <b><a href="qxmlschemavalidator.html#validate-2">validate</a></b> (<i>self</i>, QIODevice, QUrl&#160;<i>documentUri</i>&#160;=&#160;QUrl())</li><li><div class="fn" />bool <b><a href="qxmlschemavalidator.html#validate-3">validate</a></b> (<i>self</i>, QByteArray, QUrl&#160;<i>documentUri</i>&#160;=&#160;QUrl())</li></ul><a name="details" /><hr /><h2>Detailed Description</h2><p>The QXmlSchemaValidator class validates XML instance documents against a W3C XML Schema.</p>
11
 
<p>The QXmlSchemaValidator class loads, parses an XML instance document and validates it against a W3C XML Schema that has been compiled with <a href="qxmlschema.html">QXmlSchema</a>.</p>
12
 
<p>The following example shows how to load a XML Schema from a local file, check whether it is a valid schema document and use it for validation of an XML instance document:</p>
13
 
<pre>     QUrl schemaUrl("file:<span class="comment">///home/user/schema.xsd");</span>
 
9
</style></head><body><table border="0" cellpadding="0" cellspacing="0" width="100%"><tr /><td align="left" valign="top" width="32"><img align="left" border="0" height="32" src="images/rb-logo.png" width="32" /></td><td width="1">&#160;&#160;</td><td class="postheader" valign="center"><a href="../pyqt4ref.html"><font color="#004faf">Home</font></a>&#160;&#183; <a href="classes.html"><font color="#004faf">All Classes</font></a>&#160;&#183; <a href="modules.html"><font color="#004faf">Modules</font></a></td></table><h1 align="center">QXmlSchemaValidator Class Reference<br /><sup><sup>[<a href="qtxmlpatterns.html">QtXmlPatterns</a> module]</sup></sup></h1><p>The QXmlSchemaValidator class validates XML instance documents
 
10
against a W3C XML Schema. <a href="#details">More...</a></p>
 
11
 
 
12
<h3>Methods</h3><ul><li><div class="fn" /><b><a href="qxmlschemavalidator.html#QXmlSchemaValidator">__init__</a></b> (<i>self</i>)</li><li><div class="fn" /><b><a href="qxmlschemavalidator.html#QXmlSchemaValidator-2">__init__</a></b> (<i>self</i>, QXmlSchema)</li><li><div class="fn" />QAbstractMessageHandler <b><a href="qxmlschemavalidator.html#messageHandler">messageHandler</a></b> (<i>self</i>)</li><li><div class="fn" />QXmlNamePool <b><a href="qxmlschemavalidator.html#namePool">namePool</a></b> (<i>self</i>)</li><li><div class="fn" />QNetworkAccessManager <b><a href="qxmlschemavalidator.html#networkAccessManager">networkAccessManager</a></b> (<i>self</i>)</li><li><div class="fn" />QXmlSchema <b><a href="qxmlschemavalidator.html#schema">schema</a></b> (<i>self</i>)</li><li><div class="fn" /><b><a href="qxmlschemavalidator.html#setMessageHandler">setMessageHandler</a></b> (<i>self</i>, QAbstractMessageHandler)</li><li><div class="fn" /><b><a href="qxmlschemavalidator.html#setNetworkAccessManager">setNetworkAccessManager</a></b> (<i>self</i>, QNetworkAccessManager)</li><li><div class="fn" /><b><a href="qxmlschemavalidator.html#setSchema">setSchema</a></b> (<i>self</i>, QXmlSchema)</li><li><div class="fn" /><b><a href="qxmlschemavalidator.html#setUriResolver">setUriResolver</a></b> (<i>self</i>, QAbstractUriResolver)</li><li><div class="fn" />QAbstractUriResolver <b><a href="qxmlschemavalidator.html#uriResolver">uriResolver</a></b> (<i>self</i>)</li><li><div class="fn" />bool <b><a href="qxmlschemavalidator.html#validate">validate</a></b> (<i>self</i>, QUrl)</li><li><div class="fn" />bool <b><a href="qxmlschemavalidator.html#validate-2">validate</a></b> (<i>self</i>, QIODevice, QUrl&#160;<i>documentUri</i>&#160;=&#160;QUrl())</li><li><div class="fn" />bool <b><a href="qxmlschemavalidator.html#validate-3">validate</a></b> (<i>self</i>, QByteArray, QUrl&#160;<i>documentUri</i>&#160;=&#160;QUrl())</li></ul><a name="details" /><hr /><h2>Detailed Description</h2><p>The QXmlSchemaValidator class validates XML instance documents
 
13
against a W3C XML Schema.</p>
 
14
<p>The QXmlSchemaValidator class loads, parses an XML instance
 
15
document and validates it against a W3C XML Schema that has been
 
16
compiled with <a href="qxmlschema.html">QXmlSchema</a>.</p>
 
17
<p>The following example shows how to load a XML Schema from a
 
18
local file, check whether it is a valid schema document and use it
 
19
for validation of an XML instance document:</p>
 
20
<pre class="highlightedCode brush: cpp">
 
21
     QUrl schemaUrl("file:/<span class="comment">//home/user/schema.xsd");</span>
14
22
 
15
23
     QXmlSchema schema;
16
24
     schema.load(schemaUrl);
24
32
             qDebug() &lt;&lt; "instance document is valid";
25
33
         else
26
34
             qDebug() &lt;&lt; "instance document is invalid";
27
 
     }</pre>
28
 
<a name="xml-schema-version" />
 
35
     }
 
36
</pre>
 
37
<a id="xml-schema-version" name="xml-schema-version" />
29
38
<h3>XML Schema Version</h3>
30
 
<p>This class implements schema validation according to the <a href="http://www.w3.org/XML/Schema">XML Schema</a> 1.0 specification.</p>
31
 
<p>See also <a href="qxmlschema.html">QXmlSchema</a> and <a href="xmlpatterns-schema.html">XML Schema Validation Example</a>.</p>
32
 
<hr /><h2>Method Documentation</h2><h3 class="fn"><a name="QXmlSchemaValidator" />QXmlSchemaValidator.__init__ (<i>self</i>)</h3><p>Constructs a schema validator. The schema used for validation must be referenced in the XML instance document via the <tt>xsi:schemaLocation</tt> or <tt>xsi:noNamespaceSchemaLocation</tt> attribute.</p>
33
 
<h3 class="fn"><a name="QXmlSchemaValidator-2" />QXmlSchemaValidator.__init__ (<i>self</i>, <a href="qxmlschema.html">QXmlSchema</a>)</h3><p>Constructs a schema validator that will use <i>schema</i> for validation. If an empty <a href="qxmlschema.html">QXmlSchema</a> schema is passed to the validator, the schema used for validation must be referenced in the XML instance document via the <tt>xsi:schemaLocation</tt> or <tt>xsi:noNamespaceSchemaLocation</tt> attribute.</p>
34
 
<a name="//apple_ref/cpp/instm/QXmlSchemaValidator/~QXmlSchemaValidator" />
35
 
<h3 class="fn"><a name="messageHandler" /><a href="qabstractmessagehandler.html">QAbstractMessageHandler</a> QXmlSchemaValidator.messageHandler (<i>self</i>)</h3><p>Returns the message handler that handles parsing and validation messages for this <a href="qxmlschemavalidator.html">QXmlSchemaValidator</a>.</p>
 
39
<p>This class implements schema validation according to the
 
40
<a href="http://www.w3.org/XML/Schema">XML Schema</a> 1.0
 
41
specification.</p>
 
42
<hr /><h2>Method Documentation</h2><h3 class="fn"><a name="QXmlSchemaValidator" />QXmlSchemaValidator.__init__ (<i>self</i>)</h3><p>Constructs a schema validator. The schema used for validation
 
43
must be referenced in the XML instance document via the
 
44
<tt>xsi:schemaLocation</tt> or
 
45
<tt>xsi:noNamespaceSchemaLocation</tt> attribute.</p>
 
46
 
 
47
 
 
48
<h3 class="fn"><a name="QXmlSchemaValidator-2" />QXmlSchemaValidator.__init__ (<i>self</i>, <a href="qxmlschema.html">QXmlSchema</a>)</h3><p>Constructs a schema validator that will use <i>schema</i> for
 
49
validation. If an empty <a href="qxmlschema.html">QXmlSchema</a>
 
50
schema is passed to the validator, the schema used for validation
 
51
must be referenced in the XML instance document via the
 
52
<tt>xsi:schemaLocation</tt> or
 
53
<tt>xsi:noNamespaceSchemaLocation</tt> attribute.</p>
 
54
 
 
55
 
 
56
<h3 class="fn"><a name="messageHandler" /><a href="qabstractmessagehandler.html">QAbstractMessageHandler</a> QXmlSchemaValidator.messageHandler (<i>self</i>)</h3><p>Returns the message handler that handles parsing and validation
 
57
messages for this <a href="qxmlschemavalidator.html">QXmlSchemaValidator</a>.</p>
36
58
<p>See also <a href="qxmlschemavalidator.html#setMessageHandler">setMessageHandler</a>().</p>
37
 
<a name="//apple_ref/cpp/instm/QXmlSchemaValidator/namePool" />
38
 
<h3 class="fn"><a name="namePool" /><a href="qxmlnamepool.html">QXmlNamePool</a> QXmlSchemaValidator.namePool (<i>self</i>)</h3><p>Returns the name pool used by this <a href="qxmlschemavalidator.html">QXmlSchemaValidator</a> for constructing <a href="qxmlname.html">names</a>. There is no setter for the name pool, because mixing name pools causes errors due to name confusion.</p>
39
 
<a name="//apple_ref/cpp/instm/QXmlSchemaValidator/networkAccessManager" />
 
59
 
 
60
 
 
61
<h3 class="fn"><a name="namePool" /><a href="qxmlnamepool.html">QXmlNamePool</a> QXmlSchemaValidator.namePool (<i>self</i>)</h3><p>Returns the name pool used by this <a href="qxmlschemavalidator.html">QXmlSchemaValidator</a> for constructing
 
62
<a href="qxmlname.html">names</a>. There is no setter for the name
 
63
pool, because mixing name pools causes errors due to name
 
64
confusion.</p>
 
65
 
 
66
 
40
67
<h3 class="fn"><a name="networkAccessManager" /><a href="qnetworkaccessmanager.html">QNetworkAccessManager</a> QXmlSchemaValidator.networkAccessManager (<i>self</i>)</h3><p>Returns the network manager, or 0 if it has not been set.</p>
41
68
<p>See also <a href="qxmlschemavalidator.html#setNetworkAccessManager">setNetworkAccessManager</a>().</p>
42
 
<a name="//apple_ref/cpp/instm/QXmlSchemaValidator/schema" />
 
69
 
 
70
 
43
71
<h3 class="fn"><a name="schema" /><a href="qxmlschema.html">QXmlSchema</a> QXmlSchemaValidator.schema (<i>self</i>)</h3><p>Returns the schema that is used for validation.</p>
44
72
<p>See also <a href="qxmlschemavalidator.html#setSchema">setSchema</a>().</p>
45
 
<a name="//apple_ref/cpp/instm/QXmlSchemaValidator/setMessageHandler" />
46
 
<h3 class="fn"><a name="setMessageHandler" />QXmlSchemaValidator.setMessageHandler (<i>self</i>, <a href="qabstractmessagehandler.html">QAbstractMessageHandler</a>)</h3><p>Changes the <a href="qabstractmessagehandler.html">message handler</a> for this <a href="qxmlschemavalidator.html">QXmlSchemaValidator</a> to <i>handler</i>. The schema validator sends all parsing and validation messages to this message handler. <a href="qxmlschemavalidator.html">QXmlSchemaValidator</a> does not take ownership of <i>handler</i>.</p>
47
 
<p>Normally, the default message handler is sufficient. It writes compile and validation messages to <i>stderr</i>. The default message handler includes color codes if <i>stderr</i> can render colors.</p>
48
 
<p>When <a href="qxmlschemavalidator.html">QXmlSchemaValidator</a> calls <a href="qabstractmessagehandler.html#message">QAbstractMessageHandler.message</a>(), the arguments are as follows:</p>
49
 
<p><table align="center" border="0" cellpadding="2" cellspacing="1" class="generic">
50
 
<thead><tr class="qt-style" valign="top"><th>message() argument</th><th>Semantics</th></tr></thead>
51
 
<tr class="odd" valign="top"><td><a href="qtcore.html#QtMsgType-enum">QtMsgType</a> type</td><td>Only <a href="qtcore.html#QtMsgType-enum">QtWarningMsg</a> and <a href="qtcore.html#QtMsgType-enum">QtFatalMsg</a> are used. The former identifies a warning, while the latter identifies an error.</td></tr>
52
 
<tr class="even" valign="top"><td>const <a href="qstring.html">QString</a> &amp; description</td><td>An XHTML document which is the actual message. It is translated into the current language.</td></tr>
53
 
<tr class="odd" valign="top"><td>const <a href="qurl.html">QUrl</a> &amp;identifier</td><td>Identifies the error with a URI, where the fragment is the error code, and the rest of the URI is the error namespace.</td></tr>
54
 
<tr class="even" valign="top"><td>const <a href="qsourcelocation.html">QSourceLocation</a> &amp; sourceLocation</td><td>Identifies where the error occurred.</td></tr>
55
 
</table></p>
 
73
 
 
74
 
 
75
<h3 class="fn"><a name="setMessageHandler" />QXmlSchemaValidator.setMessageHandler (<i>self</i>, <a href="qabstractmessagehandler.html">QAbstractMessageHandler</a>)</h3><p>Changes the <a href="qabstractmessagehandler.html">message
 
76
handler</a> for this <a href="qxmlschemavalidator.html">QXmlSchemaValidator</a> to
 
77
<i>handler</i>. The schema validator sends all parsing and
 
78
validation messages to this message handler. <a href="qxmlschemavalidator.html">QXmlSchemaValidator</a> does not take
 
79
ownership of <i>handler</i>.</p>
 
80
<p>Normally, the default message handler is sufficient. It writes
 
81
compile and validation messages to <i>stderr</i>. The default
 
82
message handler includes color codes if <i>stderr</i> can render
 
83
colors.</p>
 
84
<p>When <a href="qxmlschemavalidator.html">QXmlSchemaValidator</a>
 
85
calls <a href="qabstractmessagehandler.html#message">QAbstractMessageHandler.message</a>(),
 
86
the arguments are as follows:</p>
 
87
<table class="generic">
 
88
<thead>
 
89
<tr class="qt-style topAlign">
 
90
<th>message() argument</th>
 
91
<th>Semantics</th>
 
92
</tr>
 
93
</thead>
 
94
<tr class="odd topAlign">
 
95
<td>
 
96
<p><a href="qtcore.html#QtMsgType-enum">QtMsgType</a> type</p>
 
97
</td>
 
98
<td>
 
99
<p>Only <a href="qtcore.html#QtMsgType-enum">QtWarningMsg</a> and
 
100
<a href="qtcore.html#QtMsgType-enum">QtFatalMsg</a> are used. The
 
101
former identifies a warning, while the latter identifies an
 
102
error.</p>
 
103
</td>
 
104
</tr>
 
105
<tr class="even topAlign">
 
106
<td>
 
107
<p>const <a href="qstring.html">QString</a> &amp; description</p>
 
108
</td>
 
109
<td>
 
110
<p>An XHTML document which is the actual message. It is translated
 
111
into the current language.</p>
 
112
</td>
 
113
</tr>
 
114
<tr class="odd topAlign">
 
115
<td>
 
116
<p>const <a href="qurl.html">QUrl</a> &amp;identifier</p>
 
117
</td>
 
118
<td>
 
119
<p>Identifies the error with a URI, where the fragment is the error
 
120
code, and the rest of the URI is the error namespace.</p>
 
121
</td>
 
122
</tr>
 
123
<tr class="even topAlign">
 
124
<td>
 
125
<p>const <a href="qsourcelocation.html">QSourceLocation</a> &amp;
 
126
sourceLocation</p>
 
127
</td>
 
128
<td>
 
129
<p>Identifies where the error occurred.</p>
 
130
</td>
 
131
</tr>
 
132
</table>
56
133
<p>See also <a href="qxmlschemavalidator.html#messageHandler">messageHandler</a>().</p>
57
 
<a name="//apple_ref/cpp/instm/QXmlSchemaValidator/setNetworkAccessManager" />
58
 
<h3 class="fn"><a name="setNetworkAccessManager" />QXmlSchemaValidator.setNetworkAccessManager (<i>self</i>, <a href="qnetworkaccessmanager.html">QNetworkAccessManager</a>)</h3><p>Sets the network manager to <i>manager</i>. <a href="qxmlschemavalidator.html">QXmlSchemaValidator</a> does not take ownership of <i>manager</i>.</p>
 
134
 
 
135
 
 
136
<h3 class="fn"><a name="setNetworkAccessManager" />QXmlSchemaValidator.setNetworkAccessManager (<i>self</i>, <a href="qnetworkaccessmanager.html">QNetworkAccessManager</a>)</h3><p>Sets the network manager to <i>manager</i>. <a href="qxmlschemavalidator.html">QXmlSchemaValidator</a> does not take
 
137
ownership of <i>manager</i>.</p>
59
138
<p>See also <a href="qxmlschemavalidator.html#networkAccessManager">networkAccessManager</a>().</p>
60
 
<a name="//apple_ref/cpp/instm/QXmlSchemaValidator/setSchema" />
61
 
<h3 class="fn"><a name="setSchema" />QXmlSchemaValidator.setSchema (<i>self</i>, <a href="qxmlschema.html">QXmlSchema</a>)</h3><p>Sets the <i>schema</i> that shall be used for further validation. If the schema is empty, the schema used for validation must be referenced in the XML instance document via the <tt>xsi:schemaLocation</tt> or <tt>xsi:noNamespaceSchemaLocation</tt> attribute.</p>
 
139
 
 
140
 
 
141
<h3 class="fn"><a name="setSchema" />QXmlSchemaValidator.setSchema (<i>self</i>, <a href="qxmlschema.html">QXmlSchema</a>)</h3><p>Sets the <i>schema</i> that shall be used for further
 
142
validation. If the schema is empty, the schema used for validation
 
143
must be referenced in the XML instance document via the
 
144
<tt>xsi:schemaLocation</tt> or
 
145
<tt>xsi:noNamespaceSchemaLocation</tt> attribute.</p>
62
146
<p>See also <a href="qxmlschemavalidator.html#schema">schema</a>().</p>
63
 
<a name="//apple_ref/cpp/instm/QXmlSchemaValidator/setUriResolver" />
64
 
<h3 class="fn"><a name="setUriResolver" />QXmlSchemaValidator.setUriResolver (<i>self</i>, <a href="qabstracturiresolver.html">QAbstractUriResolver</a>)</h3><p>Sets the URI resolver to <i>resolver</i>. <a href="qxmlschemavalidator.html">QXmlSchemaValidator</a> does not take ownership of <i>resolver</i>.</p>
 
147
 
 
148
 
 
149
<h3 class="fn"><a name="setUriResolver" />QXmlSchemaValidator.setUriResolver (<i>self</i>, <a href="qabstracturiresolver.html">QAbstractUriResolver</a>)</h3><p>Sets the URI resolver to <i>resolver</i>. <a href="qxmlschemavalidator.html">QXmlSchemaValidator</a> does not take
 
150
ownership of <i>resolver</i>.</p>
65
151
<p>See also <a href="qxmlschemavalidator.html#uriResolver">uriResolver</a>().</p>
66
 
<a name="//apple_ref/cpp/instm/QXmlSchemaValidator/uriResolver" />
67
 
<h3 class="fn"><a name="uriResolver" /><a href="qabstracturiresolver.html">QAbstractUriResolver</a> QXmlSchemaValidator.uriResolver (<i>self</i>)</h3><p>Returns the schema's URI resolver. If no URI resolver has been set, <a href="qtxmlpatterns.html">QtXmlPatterns</a> will use the URIs in instance documents as they are.</p>
68
 
<p>The URI resolver provides a level of abstraction, or <i>polymorphic URIs</i>. A resolver can rewrite <i>logical</i> URIs to physical ones, or it can translate obsolete or invalid URIs to valid ones.</p>
69
 
<p>When <a href="qtxmlpatterns.html">QtXmlPatterns</a> calls <a href="qabstracturiresolver.html#resolve">QAbstractUriResolver.resolve</a>() the absolute URI is the URI mandated by the schema specification, and the relative URI is the URI specified by the user.</p>
 
152
 
 
153
 
 
154
<h3 class="fn"><a name="uriResolver" /><a href="qabstracturiresolver.html">QAbstractUriResolver</a> QXmlSchemaValidator.uriResolver (<i>self</i>)</h3><p>Returns the schema's URI resolver. If no URI resolver has been
 
155
set, <a href="qtxmlpatterns.html">QtXmlPatterns</a> will use the
 
156
URIs in instance documents as they are.</p>
 
157
<p>The URI resolver provides a level of abstraction, or
 
158
<i>polymorphic URIs</i>. A resolver can rewrite <i>logical</i> URIs
 
159
to physical ones, or it can translate obsolete or invalid URIs to
 
160
valid ones.</p>
 
161
<p>When <a href="qtxmlpatterns.html">QtXmlPatterns</a> calls
 
162
<a href="qabstracturiresolver.html#resolve">QAbstractUriResolver.resolve</a>()
 
163
the absolute URI is the URI mandated by the schema specification,
 
164
and the relative URI is the URI specified by the user.</p>
70
165
<p>See also <a href="qxmlschemavalidator.html#setUriResolver">setUriResolver</a>().</p>
71
 
<a name="//apple_ref/cpp/instm/QXmlSchemaValidator/validate" />
72
 
<h3 class="fn"><a name="validate" />bool QXmlSchemaValidator.validate (<i>self</i>, <a href="qurl.html">QUrl</a>)</h3><p>Validates the XML instance document read from <i>source</i> against the schema.</p>
73
 
<p>Returns <tt>true</tt> if the XML instance document is valid according to the schema, <tt>false</tt> otherwise.</p>
 
166
 
 
167
 
 
168
<h3 class="fn"><a name="validate" />bool QXmlSchemaValidator.validate (<i>self</i>, <a href="qurl.html">QUrl</a>)</h3><p>Validates the XML instance document read from <i>source</i>
 
169
against the schema.</p>
 
170
<p>Returns <tt>true</tt> if the XML instance document is valid
 
171
according to the schema, <tt>false</tt> otherwise.</p>
74
172
<p>Example:</p>
75
 
<pre>     const QXmlSchema schema = getSchema();
 
173
<pre class="highlightedCode brush: cpp">
 
174
     const QXmlSchema schema = getSchema();
76
175
 
77
 
     const QUrl url("http:<span class="comment">//www.schema-example.org/test.xml");</span>
 
176
     const QUrl url("http://www.schema-example.org/test.xml");
78
177
 
79
178
     QXmlSchemaValidator validator(schema);
80
179
     if (validator.validate(url))
81
180
         qDebug() &lt;&lt; "instance document is valid";
82
181
     else
83
 
         qDebug() &lt;&lt; "instance document is invalid";</pre>
84
 
<h3 class="fn"><a name="validate-2" />bool QXmlSchemaValidator.validate (<i>self</i>, <a href="qiodevice.html">QIODevice</a>, <a href="qurl.html">QUrl</a>&#160;<i>documentUri</i>&#160;=&#160;QUrl())</h3><p>Validates the XML instance document read from <i>source</i> with the given <i>documentUri</i> against the schema.</p>
85
 
<p>Returns <tt>true</tt> if the XML instance document is valid according to the schema, <tt>false</tt> otherwise.</p>
 
182
         qDebug() &lt;&lt; "instance document is invalid";
 
183
</pre>
 
184
 
 
185
 
 
186
<h3 class="fn"><a name="validate-2" />bool QXmlSchemaValidator.validate (<i>self</i>, <a href="qiodevice.html">QIODevice</a>, <a href="qurl.html">QUrl</a>&#160;<i>documentUri</i>&#160;=&#160;QUrl())</h3><p>Validates the XML instance document read from <i>source</i> with
 
187
the given <i>documentUri</i> against the schema.</p>
 
188
<p>Returns <tt>true</tt> if the XML instance document is valid
 
189
according to the schema, <tt>false</tt> otherwise.</p>
86
190
<p>Example:</p>
87
 
<pre>     const QXmlSchema schema = getSchema();
 
191
<pre class="highlightedCode brush: cpp">
 
192
     const QXmlSchema schema = getSchema();
88
193
 
89
194
     QFile file("test.xml");
90
195
     file.open(QIODevice.ReadOnly);
93
198
     if (validator.validate(&amp;file, QUrl.fromLocalFile(file.fileName())))
94
199
         qDebug() &lt;&lt; "instance document is valid";
95
200
     else
96
 
         qDebug() &lt;&lt; "instance document is invalid";</pre>
97
 
<h3 class="fn"><a name="validate-3" />bool QXmlSchemaValidator.validate (<i>self</i>, <a href="qbytearray.html">QByteArray</a>, <a href="qurl.html">QUrl</a>&#160;<i>documentUri</i>&#160;=&#160;QUrl())</h3><p>Validates the XML instance document read from <i>data</i> with the given <i>documentUri</i> against the schema.</p>
98
 
<p>Returns <tt>true</tt> if the XML instance document is valid according to the schema, <tt>false</tt> otherwise.</p>
 
201
         qDebug() &lt;&lt; "instance document is invalid";
 
202
</pre>
 
203
 
 
204
 
 
205
<h3 class="fn"><a name="validate-3" />bool QXmlSchemaValidator.validate (<i>self</i>, <a href="qbytearray.html">QByteArray</a>, <a href="qurl.html">QUrl</a>&#160;<i>documentUri</i>&#160;=&#160;QUrl())</h3><p>Validates the XML instance document read from <i>data</i> with
 
206
the given <i>documentUri</i> against the schema.</p>
 
207
<p>Returns <tt>true</tt> if the XML instance document is valid
 
208
according to the schema, <tt>false</tt> otherwise.</p>
99
209
<p>Example:</p>
100
 
<pre>     const QXmlSchema schema = getSchema();
 
210
<pre class="highlightedCode brush: cpp">
 
211
     const QXmlSchema schema = getSchema();
101
212
 
102
213
     QByteArray data("&lt;?xml version=\"1.0\" encoding=\"UTF-8\"?&gt;"
103
214
                     "&lt;test&gt;&lt;/test&gt;");
109
220
     if (validator.validate(&amp;buffer))
110
221
         qDebug() &lt;&lt; "instance document is valid";
111
222
     else
112
 
         qDebug() &lt;&lt; "instance document is invalid";</pre>
113
 
<p /><address><hr /><div align="center"><table border="0" cellspacing="0" width="100%"><tr class="address"><td align="left" width="25%">PyQt&#160;4.7.7 for X11</td><td align="center" width="50%">Copyright &#169; <a href="http://www.riverbankcomputing.com">Riverbank&#160;Computing&#160;Ltd</a> and <a href="http://www.qtsoftware.com">Nokia</a> 2010</td><td align="right" width="25%">Qt&#160;4.6.3</td></tr></table></div></address></body></html>
 
 
b'\\ No newline at end of file'
 
223
         qDebug() &lt;&lt; "instance document is invalid";
 
224
</pre>
 
225
<address><hr /><div align="center"><table border="0" cellspacing="0" width="100%"><tr class="address"><td align="left" width="25%">PyQt&#160;4.8.1 for X11</td><td align="center" width="50%">Copyright &#169; <a href="http://www.riverbankcomputing.com">Riverbank&#160;Computing&#160;Ltd</a> and <a href="http://www.qtsoftware.com">Nokia</a> 2010</td><td align="right" width="25%">Qt&#160;4.7.0</td></tr></table></div></address></body></html>
 
 
b'\\ No newline at end of file'