PythonQt.QtXmlPatterns.QXmlSchemaValidator · declarations 001
Back to PythonQt.QtXmlPatterns.QXmlSchemaValidator
messageHandler
messageHandler() -> Any
X.messageHandler() -> PythonQt.QtXmlPatterns.QAbstractMessageHandler
Supplemental documentation: Qt 5 reference:
QAbstractMessageHandler *QXmlSchemaValidator::messageHandler() const
Returns the message handler that handles parsing and validation messages for this QXmlSchemaValidator.
See also setMessageHandler().
Upstream PySide2 reference signatures (binding differences may apply):
messageHandler(self) -> PySide2.QtXmlPatterns.QAbstractMessageHandler
Source: https://doc.qt.io/archives/qt-5.15/qxmlschemavalidator.html#messageHandler
namePool
namePool() -> Any
X.namePool() -> PythonQt.QtXmlPatterns.QXmlNamePool
Supplemental documentation: Qt 5 reference:
QXmlNamePool QXmlSchemaValidator::namePool() const
Returns the name pool used by this QXmlSchemaValidator for constructing names. There is no setter for the name pool, because mixing name pools causes errors due to name confusion.
Upstream PySide2 reference signatures (binding differences may apply):
namePool(self) -> PySide2.QtXmlPatterns.QXmlNamePool
Source: https://doc.qt.io/archives/qt-5.15/qxmlschemavalidator.html#namePool
networkAccessManager
networkAccessManager() -> Any
X.networkAccessManager() -> PythonQt.QtNetwork.QNetworkAccessManager
Supplemental documentation: Qt 5 reference:
QNetworkAccessManager *QXmlSchemaValidator::networkAccessManager() const
Returns the network manager, or 0 if it has not been set.
See also setNetworkAccessManager().
Source: https://doc.qt.io/archives/qt-5.15/qxmlschemavalidator.html#networkAccessManager
setMessageHandler
setMessageHandler(handler: Any) -> None
X.setMessageHandler(handler)
Supplemental documentation: Qt 5 reference:
void QXmlSchemaValidator::setMessageHandler(QAbstractMessageHandler *handler)
Changes the message handler for this QXmlSchemaValidator to handler. The schema validator sends all parsing and validation messages to this message handler. QXmlSchemaValidator does not take ownership of handler.
Normally, the default message handler is sufficient. It writes compile and validation messages to stderr. The default message handler includes color codes if stderr can render colors.
When QXmlSchemaValidator calls QAbstractMessageHandler::message(), the arguments are as follows:
| message() argument | Semantics |
|---|---|
| QtMsgType type | Only QtWarningMsg and QtFatalMsg are used. The former identifies a warning, while the latter identifies an error. |
| const QString \& description | An XHTML document which is the actual message. It is translated into the current language. |
| const QUrl \&identifier | Identifies the error with a URI, where the fragment is the error code, and the rest of the URI is the error namespace. |
| const QSourceLocation \& sourceLocation | Identifies where the error occurred. |
See also messageHandler().
Upstream PySide2 reference signatures (binding differences may apply):
setMessageHandler(self, handler: PySide2.QtXmlPatterns.QAbstractMessageHandler) -> None
Source: https://doc.qt.io/archives/qt-5.15/qxmlschemavalidator.html#setMessageHandler
setNetworkAccessManager
setNetworkAccessManager(networkmanager: Any) -> Any
X.setNetworkAccessManager(networkmanager)
Supplemental documentation: Qt 5 reference:
void QXmlSchemaValidator::setNetworkAccessManager(QNetworkAccessManager *manager)
Sets the network manager to manager. QXmlSchemaValidator does not take ownership of manager.
See also networkAccessManager().
Source: https://doc.qt.io/archives/qt-5.15/qxmlschemavalidator.html#setNetworkAccessManager
setSchema
setSchema(schema: Any) -> None
X.setSchema(schema)
Supplemental documentation: Qt 5 reference:
void QXmlSchemaValidator::setSchema(const QXmlSchema \&schema)
Sets the schema 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
xsi:schemaLocation or xsi:noNamespaceSchemaLocation attribute.
See also schema().
Upstream PySide2 reference signatures (binding differences may apply):
setSchema(self, schema: PySide2.QtXmlPatterns.QXmlSchema) -> None
Source: https://doc.qt.io/archives/qt-5.15/qxmlschemavalidator.html#setSchema
setUriResolver
setUriResolver(resolver: Any) -> None
X.setUriResolver(resolver)
Supplemental documentation: Qt 5 reference:
void QXmlSchemaValidator::setUriResolver(const QAbstractUriResolver *resolver)
Sets the URI resolver to resolver. QXmlSchemaValidator does not take ownership of resolver.
See also uriResolver().
Upstream PySide2 reference signatures (binding differences may apply):
setUriResolver(self, resolver: PySide2.QtXmlPatterns.QAbstractUriResolver) -> None
Source: https://doc.qt.io/archives/qt-5.15/qxmlschemavalidator.html#setUriResolver
uriResolver
uriResolver() -> Any
X.uriResolver() -> PythonQt.QtXmlPatterns.QAbstractUriResolver
Supplemental documentation: Qt 5 reference:
const QAbstractUriResolver *QXmlSchemaValidator::uriResolver() const
Returns the schema's URI resolver. If no URI resolver has been set, Qt XML Patterns will use the URIs in instance documents as they are.
The URI resolver provides a level of abstraction, or polymorphic URIs. A resolver can rewrite logical URIs to physical ones, or it can translate obsolete or invalid URIs to valid ones.
When Qt XML Patterns calls QAbstractUriResolver::resolve() the absolute URI is the URI mandated by the schema specification, and the relative URI is the URI specified by the user.
See also setUriResolver().
Upstream PySide2 reference signatures (binding differences may apply):
uriResolver(self) -> PySide2.QtXmlPatterns.QAbstractUriResolver
Source: https://doc.qt.io/archives/qt-5.15/qxmlschemavalidator.html#uriResolver
validate
validate(source: Any, documentUri: Any) -> bool
X.validate(source, documentUri) -> bool
Supplemental documentation: Qt 5 reference:
bool QXmlSchemaValidator::validate(const QUrl \&source) const
Validates the XML instance document read from source against the schema.
Returns true if the XML instance document is valid according to the schema, false
otherwise.
Example:
const QXmlSchema schema = getSchema();
const QUrl url("http://www.schema-example.org/test.xml");
QXmlSchemaValidator validator(schema);
if (validator.validate(url))
qDebug() << "instance document is valid";
else
qDebug() << "instance document is invalid";
bool QXmlSchemaValidator::validate(QIODevice *source, const QUrl \&documentUri \= QUrl()) const
Validates the XML instance document read from source with the given documentUri against the schema.
Returns true if the XML instance document is valid according to the schema, false
otherwise.
Example:
const QXmlSchema schema = getSchema();
QFile file("test.xml");
file.open(QIODevice::ReadOnly);
QXmlSchemaValidator validator(schema);
if (validator.validate(&file, QUrl::fromLocalFile(file.fileName())))
qDebug() << "instance document is valid";
else
qDebug() << "instance document is invalid";
bool QXmlSchemaValidator::validate(const QByteArray \&data, const QUrl \&documentUri \= QUrl()) const
Validates the XML instance document read from data with the given documentUri against the schema.
Returns true if the XML instance document is valid according to the schema, false
otherwise.
Example:
const QXmlSchema schema = getSchema();
QByteArray data("<?xml version=\"1.0\" encoding=\"UTF-8\"?>"
"<test></test>");
QBuffer buffer(&data);
buffer.open(QIODevice::ReadOnly);
QXmlSchemaValidator validator(schema);
if (validator.validate(&buffer))
qDebug() << "instance document is valid";
else
qDebug() << "instance document is invalid";
Upstream PySide2 reference signatures (binding differences may apply):
validate(self, data: PySide2.QtCore.QByteArray, documentUri: PySide2.QtCore.QUrl=...) -> bool
validate(self, source: PySide2.QtCore.QIODevice, documentUri: PySide2.QtCore.QUrl=...) -> bool
validate(self, source: PySide2.QtCore.QUrl) -> bool
Source: https://doc.qt.io/archives/qt-5.15/qxmlschemavalidator.html#validate