libxml++ 2.42.3
|
XSD schema validator. More...
#include <libxml++/validators/xsdvalidator.h>
Public Member Functions | |
XsdValidator () | |
XsdValidator (const Document * document) | |
Create a validator and parse a schema definition document. | |
XsdValidator (const Glib::ustring & filename) | |
Create a validator and parse a schema definition file. | |
XsdValidator (XsdSchema * schema, bool take_ownership) | |
Create a validator. | |
~XsdValidator () override | |
XsdSchema * | get_schema () |
Get the schema. | |
const XsdSchema * | get_schema () const |
Get the schema. | |
operator BoolExpr () const override | |
Test whether a schema has been parsed. | |
void | parse_document (const Document * document) override |
Parse a schema definition from a document. | |
void | parse_file (const Glib::ustring & filename) override |
Parse a schema definition file. | |
void | parse_memory (const Glib::ustring & contents) override |
Parse a schema definition from a string. | |
void | set_schema (XsdSchema * schema, bool take_ownership) |
Set a schema. | |
void | validate (const Document * document) override |
Validate a document, using a previously parsed schema. | |
void | validate (const Glib::ustring & filename) override |
Validate an XML file, using a previously parsed schema. | |
![]() | |
SchemaValidatorBase () | |
~SchemaValidatorBase () override | |
virtual | operator BoolExpr () const =0 |
Test whether a schema has been parsed. | |
virtual void | parse_document (const Document * document)=0 |
Parse a schema definition from a document. | |
virtual void | parse_file (const Glib::ustring & filename)=0 |
Parse a schema definition file. | |
virtual void | parse_memory (const Glib::ustring & contents)=0 |
Parse a schema definition from a string. | |
virtual void | validate (const Document * document)=0 |
Validate a document, using a previously parsed schema. | |
virtual void | validate (const Glib::ustring & filename)=0 |
Validate an XML file, using a previously parsed schema. | |
![]() | |
Validator () | |
~Validator () override | |
Protected Member Functions | |
void | initialize_valid () override |
void | release_underlying () override |
void | initialize_valid () override |
void | release_underlying () override |
![]() | |
virtual void | check_for_exception () |
virtual void | check_for_validity_messages () |
virtual void | handleException (const exception & e) |
virtual void | initialize_valid () |
virtual void | on_validity_error (const Glib::ustring & message) |
virtual void | on_validity_warning (const Glib::ustring & message) |
virtual void | release_underlying () |
Additional Inherited Members | |
![]() | |
typedef const void * | BoolExpr |
This typedef is just to make it more obvious that our operator const void* should be used like operator bool(). | |
![]() | |
static void | callback_validity_error (void * ctx, const char * msg,...) |
static void | callback_validity_warning (void * ctx, const char * msg,...) |
![]() | |
exception * | exception_ |
_xmlValidCtxt * | valid_ |
Glib::ustring | validate_error_ |
Glib::ustring | validate_warning_ |
XSD schema validator.
XSD = XML Schema Definition, a.k.a. XML Schema or W3C XML Schema
xmlpp::XsdValidator::XsdValidator | ( | ) |
|
explicit |
Create a validator and parse a schema definition file.
filename | The URL of the schema. |
xmlpp::parse_error |
|
explicit |
Create a validator and parse a schema definition document.
document | A preparsed document tree, containing the schema definition. |
xmlpp::parse_error |
|
explicit |
Create a validator.
schema | A pointer to the schema to use when validating XML documents. |
take_ownership | If true , the validator takes ownership of the schema. The caller must not delete it.If false , the validator does not take ownership of the schema. The caller must guarantee that the schema exists as long as the validator keeps a pointer to it. The caller is responsible for deleting the schema when it's no longer needed. |
|
override |
XsdSchema * xmlpp::XsdValidator::get_schema | ( | ) |
Get the schema.
nullptr
. const XsdSchema * xmlpp::XsdValidator::get_schema | ( | ) | const |
Get the schema.
nullptr
.
|
overrideprotectedvirtual |
Reimplemented from xmlpp::SchemaValidatorBase.
|
overridevirtual |
Test whether a schema has been parsed.
For instance
Implements xmlpp::SchemaValidatorBase.
|
overridevirtual |
Parse a schema definition from a document.
If the validator already contains a schema, that schema is released (deleted if the validator owns the schema).
document | A preparsed document tree, containing the schema definition. |
xmlpp::parse_error |
Implements xmlpp::SchemaValidatorBase.
|
overridevirtual |
Parse a schema definition file.
If the validator already contains a schema, that schema is released (deleted if the validator owns the schema).
filename | The URL of the schema. |
xmlpp::parse_error |
Implements xmlpp::SchemaValidatorBase.
|
overridevirtual |
Parse a schema definition from a string.
If the validator already contains a schema, that schema is released (deleted if the validator owns the schema).
contents | The schema definition as a string. |
xmlpp::parse_error |
Implements xmlpp::SchemaValidatorBase.
|
overrideprotectedvirtual |
Reimplemented from xmlpp::SchemaValidatorBase.
void xmlpp::XsdValidator::set_schema | ( | XsdSchema * | schema, |
bool | take_ownership | ||
) |
Set a schema.
If the validator already contains a schema, that schema is released (deleted if the validator owns the schema).
schema | A pointer to the schema to use when validating XML documents. |
take_ownership | If true , the validator takes ownership of the schema. The caller must not delete it.If false , the validator does not take ownership of the schema. The caller must guarantee that the schema exists as long as the validator keeps a pointer to it. The caller is responsible for deleting the schema when it's no longer needed. |
|
overridevirtual |
Validate a document, using a previously parsed schema.
document | Pointer to the document. |
xmlpp::internal_error | |
xmlpp::validity_error |
Implements xmlpp::SchemaValidatorBase.
|
overridevirtual |
Validate an XML file, using a previously parsed schema.
filename | The URL of the XML file. |
xmlpp::internal_error | |
xmlpp::validity_error |
Implements xmlpp::SchemaValidatorBase.