WARNING: USE THIS SOFTWARE AT YOUR OWN RISK! THIS IS EXPERIMENTAL SOFTWARE NOT INTENDED FOR PRODUCTION USE! Zuble is currently an early stage prototype. As such Zuble is minimally tested and inherently unstable. It is provided for experimental, development, and demonstration purposes only. Zuble QML Types   |  Zuble C++ Classes   |  Zuble Overview
Zuble  0.1
Zuble Framework C++/QML extension API
Public Slots | Signals | Public Member Functions | Static Public Member Functions | Protected Member Functions | Protected Attributes | Properties | List of all members
Zbl::ZSchemaValidator Class Reference

This class wraps the QXmlSchemaValidator and QXmlSchema classes. More...

#include <ZSchemaValidator.h>

Inheritance diagram for Zbl::ZSchemaValidator:
Inheritance graph
[legend]
Collaboration diagram for Zbl::ZSchemaValidator:
Collaboration graph
[legend]

Public Slots

bool validate ()
 Validates the current XML document against the currently loaded XML schema. More...
 

Signals

void statusMessage (QVariant message)
 

Public Member Functions

 ZSchemaValidator (QObject *parent=0)
 
QString getSchemaUrl ()
 Obtain the schema URI. More...
 
void setSchemaUrl (const QString &schemaUrl)
 Sets the URI of the XML schema to use for validating XML documents and loads the schema into memory. Use the isOK() method to determine if XML schema was loaded successfully. More...
 
QString getXmlDocUrl ()
 Obtain the XML instance document URI. More...
 
void setXmlDocUrl (const QString &xmlDocUrl)
 Sets the URI of the XML instance Document to be validated against the XML schema. More...
 
Q_INVOKABLE bool isOk ()
 Determines the status of the most recent operation. More...
 

Static Public Member Functions

static int registerType ()
 Registers this object with the QML type system. More...
 

Protected Member Functions

virtual ZBL_DECLARE_LOGGED_OBJECT void zMessage (QVariant message)
 

Protected Attributes

QUrl m_schemaUrl
 The URI to the schema against which the instance document will be validated. More...
 
QXmlSchema m_schema
 The encapsulated QXmlSchema object. More...
 
QUrl m_XmlDocUrl
 The URI to the XML instance document that will be valudated against an XML schema. More...
 
ZxMessageHandler m_msgHandler
 QXmlQuery. More...
 
bool m_status
 Most recent status. true = OK, false = failed. More...
 

Properties

QString schemaUrl
 
QString xmlDocUrl
 

Additional Inherited Members

Detailed Description

This class wraps the QXmlSchemaValidator and QXmlSchema classes.

It allows javascript programs to validate XML instance documents against an XML schema document.

Definition at line 44 of file ZSchemaValidator.h.

Constructor & Destructor Documentation

◆ ZSchemaValidator()

Zbl::ZSchemaValidator::ZSchemaValidator ( QObject *  parent = 0)
explicit

Definition at line 34 of file ZSchemaValidator.cpp.

Member Function Documentation

◆ getSchemaUrl()

QString Zbl::ZSchemaValidator::getSchemaUrl ( )

Obtain the schema URI.

Returns
a QString containing the URI of the schema against which XML documents will be validated.

Definition at line 57 of file ZSchemaValidator.cpp.

◆ getXmlDocUrl()

QString Zbl::ZSchemaValidator::getXmlDocUrl ( )

Obtain the XML instance document URI.

Returns
a QString containing the URI of the XML document to be validated.

Definition at line 96 of file ZSchemaValidator.cpp.

◆ isOk()

bool Zbl::ZSchemaValidator::isOk ( )

Determines the status of the most recent operation.

Returns
true if most recent operation was successful, false if an error occurred

Definition at line 106 of file ZSchemaValidator.cpp.

◆ registerType()

int Zbl::ZSchemaValidator::registerType ( )
static

Registers this object with the QML type system.

Returns
The QML type id

Definition at line 45 of file ZSchemaValidator.cpp.

Referenced by Zbl::Zblcore::registerTypes().

◆ setSchemaUrl()

void Zbl::ZSchemaValidator::setSchemaUrl ( const QString &  schemaUrl)

Sets the URI of the XML schema to use for validating XML documents and loads the schema into memory. Use the isOK() method to determine if XML schema was loaded successfully.

Parameters
schemaUrlA URI that references an XML schema.

Definition at line 62 of file ZSchemaValidator.cpp.

◆ setXmlDocUrl()

void Zbl::ZSchemaValidator::setXmlDocUrl ( const QString &  xmlDocUrl)

Sets the URI of the XML instance Document to be validated against the XML schema.

Parameters
xmlDocUrlA URI that references an XML Document.

Definition at line 101 of file ZSchemaValidator.cpp.

◆ statusMessage

void Zbl::ZSchemaValidator::statusMessage ( QVariant  message)
signal

Referenced by zMessage().

◆ validate

bool Zbl::ZSchemaValidator::validate ( )
slot

Validates the current XML document against the currently loaded XML schema.

Returns
true if XML document validated successfully, false if validation failed

Definition at line 70 of file ZSchemaValidator.cpp.

◆ zMessage()

void Zbl::ZSchemaValidator::zMessage ( QVariant  message)
protectedvirtual

Implements Zbl::ZxMessageListener.

Definition at line 40 of file ZSchemaValidator.cpp.

Member Data Documentation

◆ m_msgHandler

ZxMessageHandler Zbl::ZSchemaValidator::m_msgHandler
protected

QXmlQuery.

Definition at line 158 of file ZSchemaValidator.h.

Referenced by validate().

◆ m_schema

QXmlSchema Zbl::ZSchemaValidator::m_schema
protected

The encapsulated QXmlSchema object.

Definition at line 145 of file ZSchemaValidator.h.

Referenced by setSchemaUrl(), and validate().

◆ m_schemaUrl

QUrl Zbl::ZSchemaValidator::m_schemaUrl
protected

The URI to the schema against which the instance document will be validated.

Definition at line 139 of file ZSchemaValidator.h.

Referenced by getSchemaUrl(), and setSchemaUrl().

◆ m_status

bool Zbl::ZSchemaValidator::m_status
protected

Most recent status. true = OK, false = failed.

Definition at line 164 of file ZSchemaValidator.h.

Referenced by isOk(), setSchemaUrl(), and validate().

◆ m_XmlDocUrl

QUrl Zbl::ZSchemaValidator::m_XmlDocUrl
protected

The URI to the XML instance document that will be valudated against an XML schema.

Definition at line 152 of file ZSchemaValidator.h.

Referenced by getXmlDocUrl(), setXmlDocUrl(), and validate().

Property Documentation

◆ schemaUrl

QString Zbl::ZSchemaValidator::schemaUrl
readwrite

Set and get the schema URI

Definition at line 54 of file ZSchemaValidator.h.

◆ xmlDocUrl

QString Zbl::ZSchemaValidator::xmlDocUrl
readwrite

Set and get the XML Document URI

Definition at line 60 of file ZSchemaValidator.h.


The documentation for this class was generated from the following files: