Qyoto  4.0.5
Qyoto is a C# language binding for Qt
 All Classes Namespaces Functions Variables Typedefs Enumerations Properties
QXmlSchema Class Reference

The QXmlSchema class provides loading and validation of a W3C XML Schema. More...

Inheritance diagram for QXmlSchema:
Collaboration diagram for QXmlSchema:

Public Member Functions

 QXmlSchema ()
 
 
 QXmlSchema (QXmlSchema other)
 
 
virtual void CreateProxy ()
 
new QUrl DocumentUri ()
 
 
new bool IsValid ()
 
 
new bool Load (QUrl source)
 
 
new bool Load (QIODevice source)
 
 
new bool Load (QByteArray data)
 
 
new bool Load (QIODevice source, QUrl documentUri)
 
 
new bool Load (QByteArray data, QUrl documentUri)
 
 
new QXmlNamePool NamePool ()
 
 
new void Dispose ()
 

Protected Member Functions

 QXmlSchema (System.Type dummy)
 

Protected Attributes

SmokeInvocation interceptor
 

Properties

new QAbstractMessageHandler MessageHandler [get, set]
 
 
new QNetworkAccessManager NetworkAccessManager [get, set]
 
 
new QAbstractUriResolver UriResolver [get, set]
 
 
virtual System.IntPtr SmokeObject [get, set]
 

Detailed Description

The QXmlSchema class provides loading and validation of a W3C XML Schema.

The QXmlSchema class loads, compiles and validates W3C XML Schema files that can be used further for validation of XML instance documents via QXmlSchemaValidator.

The following example shows how to load a XML Schema file from the network and test whether it is a valid schema document:

QUrl url("http://www.schema-example.org/myschema.xsd");

QXmlSchema schema;

if (schema.load(url) == true)

qDebug() << "schema is valid";

else

qDebug() << "schema is invalid";

XML Schema Version

This class is used to represent schemas that conform to the XML Schema 1.0 specification.

See also QXmlSchemaValidator and XML Schema Validation Example.

Constructor & Destructor Documentation

QXmlSchema.QXmlSchema ( System.Type  dummy)
protected
QXmlSchema.QXmlSchema ( )

Constructs an invalid, empty schema that cannot be used until load() is called.

QXmlSchema.QXmlSchema ( QXmlSchema  other)

Constructs a QXmlSchema that is a copy of other. The new instance will share resources with the existing schema to the extent possible.

Member Function Documentation

virtual void QXmlSchema.CreateProxy ( )
virtual
new void QXmlSchema.Dispose ( )
new QUrl QXmlSchema.DocumentUri ( )

Returns the document URI of the schema or an empty URI if no schema has been set.

new bool QXmlSchema.IsValid ( )

Returns true if this schema is valid. Examples of invalid schemas are ones that contain syntax errors or that do not conform the W3C XML Schema specification.

new bool QXmlSchema.Load ( QUrl  source)

Sets this QXmlSchema to a schema loaded from the source URI.

If the schema is invalid, false is returned and the behavior is undefined.

Example:

QUrl url("http://www.schema-example.org/myschema.xsd&quot;);

QXmlSchema schema;

if (schema.load(url) == true)

qDebug() << "schema is valid";

else

qDebug() << "schema is invalid";

See also isValid().

new bool QXmlSchema.Load ( QIODevice  source)

Sets this QXmlSchema to a schema loaded from the source URI.

If the schema is invalid, false is returned and the behavior is undefined.

Example:

QUrl url("http://www.schema-example.org/myschema.xsd&quot;);

QXmlSchema schema;

if (schema.load(url) == true)

qDebug() << "schema is valid";

else

qDebug() << "schema is invalid";

See also isValid().

new bool QXmlSchema.Load ( QByteArray  data)

Sets this QXmlSchema to a schema loaded from the source URI.

If the schema is invalid, false is returned and the behavior is undefined.

Example:

QUrl url("http://www.schema-example.org/myschema.xsd&quot;);

QXmlSchema schema;

if (schema.load(url) == true)

qDebug() << "schema is valid";

else

qDebug() << "schema is invalid";

See also isValid().

new bool QXmlSchema.Load ( QIODevice  source,
QUrl  documentUri 
)

Sets this QXmlSchema to a schema loaded from the source URI.

If the schema is invalid, false is returned and the behavior is undefined.

Example:

QUrl url("http://www.schema-example.org/myschema.xsd&quot;);

QXmlSchema schema;

if (schema.load(url) == true)

qDebug() << "schema is valid";

else

qDebug() << "schema is invalid";

See also isValid().

new bool QXmlSchema.Load ( QByteArray  data,
QUrl  documentUri 
)

Sets this QXmlSchema to a schema loaded from the source URI.

If the schema is invalid, false is returned and the behavior is undefined.

Example:

QUrl url("http://www.schema-example.org/myschema.xsd&quot;);

QXmlSchema schema;

if (schema.load(url) == true)

qDebug() << "schema is valid";

else

qDebug() << "schema is invalid";

See also isValid().

new QXmlNamePool QXmlSchema.NamePool ( )

Returns the name pool used by this QXmlSchema for constructing names. There is no setter for the name pool, because mixing name pools causes errors due to name confusion.

Member Data Documentation

SmokeInvocation QXmlSchema.interceptor
protected

Property Documentation

new QAbstractMessageHandler QXmlSchema.MessageHandler
getset

Returns the message handler that handles compile and validation messages for this QXmlSchema.

Changes the message handler for this QXmlSchema to handler. The schema sends all compile and validation messages to this message handler. QXmlSchema 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 QXmlSchema calls QAbstractMessageHandler::message(), the arguments are as follows:

message() argumentSemantics

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.

new QNetworkAccessManager QXmlSchema.NetworkAccessManager
getset

Returns the network manager, or 0 if it has not been set.

Sets the network manager to manager. QXmlSchema does not take ownership of manager.

virtual System.IntPtr QXmlSchema.SmokeObject
getset
new QAbstractUriResolver QXmlSchema.UriResolver
getset

Returns the schema's URI resolver. If no URI resolver has been set, QtXmlPatterns will use the URIs in schemas 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 QtXmlPatterns 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.

Sets the URI resolver to resolver. QXmlSchema does not take ownership of resolver.