libxml++ 3.2.4
|
XSD schema validator. More...
#include <libxml++/validators/xsdvalidator.h>
Public Member Functions | |
LIBXMLPP_API | XsdValidator () |
LIBXMLPP_API | XsdValidator (const Document * document) |
Create a validator and parse a schema definition document. | |
LIBXMLPP_API | XsdValidator (const std::string & filename) |
Create a validator and parse a schema definition file. | |
LIBXMLPP_API | XsdValidator (XsdSchema * schema, bool take_ownership) |
Create a validator. | |
LIBXMLPP_API | ~XsdValidator () override |
LIBXMLPP_API const XsdSchema * | get_schema () const noexcept |
Get the schema. | |
LIBXMLPP_API XsdSchema * | get_schema () noexcept |
Get the schema. | |
LIBXMLPP_API | operator bool () const noexcept override |
Test whether a schema has been parsed. | |
LIBXMLPP_API void | parse_document (const Document * document) override |
Parse a schema definition from a document. | |
LIBXMLPP_API void | parse_file (const std::string & filename) override |
Parse a schema definition file. | |
LIBXMLPP_API void | parse_memory (const Glib::ustring & contents) override |
Parse a schema definition from a string. | |
LIBXMLPP_API void | set_schema (XsdSchema * schema, bool take_ownership) |
Set a schema. | |
LIBXMLPP_API void | validate (const Document * document) override |
Validate a document, using a previously parsed schema. | |
LIBXMLPP_API void | validate (const std::string & filename) override |
Validate an XML file, using a previously parsed schema. | |
![]() | |
LIBXMLPP_API | SchemaValidatorBase () noexcept |
LIBXMLPP_API | ~SchemaValidatorBase () override |
virtual LIBXMLPP_API | operator bool () const noexcept override=0 |
Test whether a schema has been parsed. | |
virtual LIBXMLPP_API void | parse_document (const Document * document)=0 |
Parse a schema definition from a document. | |
LIBXMLPP_API void | parse_file (const std::string & filename) override=0 |
Parse a schema definition file. | |
LIBXMLPP_API void | parse_memory (const Glib::ustring & contents) override=0 |
Parse a schema definition from a string. | |
LIBXMLPP_API void | validate (const Document * document) override=0 |
Validate a document, using a previously parsed schema. | |
virtual LIBXMLPP_API void | validate (const std::string & filename)=0 |
Validate an XML file, using a previously parsed schema. | |
![]() | |
LIBXMLPP_API | Validator () noexcept |
LIBXMLPP_API | ~Validator () override |
virtual LIBXMLPP_API | operator bool () const noexcept=0 |
Test whether a schema or a DTD has been parsed. | |
virtual LIBXMLPP_API void | parse_file (const std::string & filename)=0 |
Parse a schema definition file or an external subset (DTD file). | |
virtual LIBXMLPP_API void | parse_memory (const Glib::ustring & contents)=0 |
Parse a schema definition or a DTD from a string. | |
virtual LIBXMLPP_API void | validate (const Document * document)=0 |
Validate a document, using a previously parsed schema or DTD. | |
Protected Member Functions | |
LIBXMLPP_API void | initialize_context () override |
LIBXMLPP_API void | release_underlying () override |
LIBXMLPP_API void | initialize_context () override |
LIBXMLPP_API void | release_underlying () override |
![]() | |
virtual LIBXMLPP_API void | check_for_exception () |
virtual LIBXMLPP_API void | check_for_validity_messages () |
virtual LIBXMLPP_API void | handle_exception () |
To be called in an exception handler. | |
virtual LIBXMLPP_API void | initialize_context () |
virtual LIBXMLPP_API void | on_validity_error (const Glib::ustring & message) |
virtual LIBXMLPP_API void | on_validity_warning (const Glib::ustring & message) |
virtual LIBXMLPP_API void | release_underlying () |
![]() | |
NonCopyable () noexcept | |
NonCopyable (const NonCopyable &)=delete | |
NonCopyable (NonCopyable &&)=delete | |
virtual | ~NonCopyable () |
NonCopyable & | operator= (const NonCopyable &)=delete |
NonCopyable & | operator= (NonCopyable &&)=delete |
Additional Inherited Members | |
![]() | |
static LIBXMLPP_API void | callback_validity_error (void * ctx, const char * msg,...) |
static LIBXMLPP_API void | callback_validity_warning (void * ctx, const char * msg,...) |
![]() | |
std::unique_ptr< exception > | exception_ |
Glib::ustring | validate_error_ |
Glib::ustring | validate_warning_ |
XSD schema validator.
XSD = XML Schema Definition, a.k.a. XML Schema or W3C XML Schema
LIBXMLPP_API 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 |
|
noexcept |
Get the schema.
nullptr
.
|
noexcept |
Get the schema.
nullptr
.
|
overrideprotectedvirtual |
Reimplemented from xmlpp::SchemaValidatorBase.
|
explicitoverridevirtualnoexcept |
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.
LIBXMLPP_API 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.