XSD schema validator.
More...
#include <libxml++/validators/xsdvalidator.h>
XSD schema validator.
XSD = XML Schema Definition, a.k.a. XML Schema or W3C XML Schema
- Since libxml++ 2.38:
| LIBXMLPP_API xmlpp::XsdValidator::XsdValidator |
( |
| ) |
|
| LIBXMLPP_API xmlpp::XsdValidator::XsdValidator |
( |
const Glib::ustring & |
filename | ) |
|
|
explicit |
Create a validator and parse a schema definition file.
- Parameters
-
| filename | The URL of the schema. |
- Exceptions
-
| LIBXMLPP_API xmlpp::XsdValidator::XsdValidator |
( |
const Document* |
document | ) |
|
|
explicit |
Create a validator and parse a schema definition document.
- Parameters
-
| document | A preparsed document tree, containing the schema definition. |
- Exceptions
-
| LIBXMLPP_API xmlpp::XsdValidator::XsdValidator |
( |
XsdSchema* |
schema, |
|
|
bool |
take_ownership |
|
) |
| |
|
explicit |
Create a validator.
- Parameters
-
| 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. |
| LIBXMLPP_API xmlpp::XsdValidator::~XsdValidator |
( |
| ) |
|
|
override |
| LIBXMLPP_API XsdSchema* xmlpp::XsdValidator::get_schema |
( |
| ) |
|
Get the schema.
- Returns
- A pointer to the schema, or
nullptr.
| LIBXMLPP_API const XsdSchema* xmlpp::XsdValidator::get_schema |
( |
| ) |
const |
Get the schema.
- Returns
- A pointer to the schema, or
nullptr.
| LIBXMLPP_API void xmlpp::XsdValidator::initialize_valid |
( |
| ) |
|
|
overrideprotectedvirtual |
| LIBXMLPP_API xmlpp::XsdValidator::operator BoolExpr |
( |
| ) |
const |
|
overridevirtual |
| LIBXMLPP_API void xmlpp::XsdValidator::parse_document |
( |
const Document* |
document | ) |
|
|
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).
- Parameters
-
| document | A preparsed document tree, containing the schema definition. |
- Exceptions
-
Implements xmlpp::SchemaValidatorBase.
| LIBXMLPP_API void xmlpp::XsdValidator::parse_file |
( |
const Glib::ustring & |
filename | ) |
|
|
overridevirtual |
Parse a schema definition file.
If the validator already contains a schema, that schema is released (deleted if the validator owns the schema).
- Parameters
-
| filename | The URL of the schema. |
- Exceptions
-
Implements xmlpp::SchemaValidatorBase.
| LIBXMLPP_API void xmlpp::XsdValidator::parse_memory |
( |
const Glib::ustring & |
contents | ) |
|
|
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).
- Parameters
-
| contents | The schema definition as a string. |
- Exceptions
-
Implements xmlpp::SchemaValidatorBase.
| LIBXMLPP_API void xmlpp::XsdValidator::release_underlying |
( |
| ) |
|
|
overrideprotectedvirtual |
| 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).
- Parameters
-
| 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. |
| LIBXMLPP_API void xmlpp::XsdValidator::validate |
( |
const Document* |
document | ) |
|
|
overridevirtual |
Validate a document, using a previously parsed schema.
- Parameters
-
| document | Pointer to the document. |
- Exceptions
-
Implements xmlpp::SchemaValidatorBase.
| LIBXMLPP_API void xmlpp::XsdValidator::validate |
( |
const Glib::ustring & |
filename | ) |
|
|
overridevirtual |
Validate an XML file, using a previously parsed schema.
- Parameters
-
| filename | The URL of the XML file. |
- Exceptions
-
Implements xmlpp::SchemaValidatorBase.