XML Schema Validator.
More...
#include <libxml++/validators/schemavalidator.h>
|
LIBXMLPP_API | SchemaValidator () |
|
LIBXMLPP_API | SchemaValidator (const Glib::ustring & file) |
| Create a validator and parse a schema definition file immediately.
|
|
LIBXMLPP_API | SchemaValidator (Document & document) |
| Create a validator and parse a schema definition document immediately.
|
|
LIBXMLPP_API | SchemaValidator (Schema * schema) |
| Create a schema validator.
|
|
LIBXMLPP_API | ~SchemaValidator () override |
|
LIBXMLPP_API Schema * | get_schema () |
| Get the parsed schema.
|
|
LIBXMLPP_API const Schema * | get_schema () const |
| Get the parsed schema.
|
|
LIBXMLPP_API | operator bool () const |
| Test whether a schema has been parsed.
|
|
virtual LIBXMLPP_API void | parse_document (Document & document) |
| Parse a schema definition from a document.
|
|
virtual LIBXMLPP_API void | parse_file (const Glib::ustring & filename) |
| Parse a schema definition file.
|
|
virtual LIBXMLPP_API void | parse_memory (const Glib::ustring & contents) |
| Parse a schema definition from a string.
|
|
virtual LIBXMLPP_API void | set_schema (Schema * schema) |
| Set a schema.
|
|
LIBXMLPP_API bool | validate (const Document * doc) |
| Validate a document, using a previously parsed schema.
|
|
LIBXMLPP_API bool | validate (const Glib::ustring & file) |
| Validate an XML file, using a previously parsed schema.
|
|
LIBXMLPP_API | Validator () |
|
LIBXMLPP_API | ~Validator () override |
|
◆ SchemaValidator() [1/4]
LIBXMLPP_API xmlpp::SchemaValidator::SchemaValidator |
( |
| ) |
|
◆ SchemaValidator() [2/4]
LIBXMLPP_API xmlpp::SchemaValidator::SchemaValidator |
( |
const Glib::ustring & | file | ) |
|
|
explicit |
Create a validator and parse a schema definition file immediately.
- Parameters
-
file | The URL of the schema. |
- Exceptions
-
- Deprecated
- Use XsdValidator instead.
◆ SchemaValidator() [3/4]
LIBXMLPP_API xmlpp::SchemaValidator::SchemaValidator |
( |
Document & | document | ) |
|
|
explicit |
Create a validator and parse a schema definition document immediately.
- Parameters
-
document | A preparsed document tree, containing the schema definition. |
- Note
- The document may be modified during the parsing process.
- Exceptions
-
- Deprecated
- Use XsdValidator instead.
◆ SchemaValidator() [4/4]
LIBXMLPP_API xmlpp::SchemaValidator::SchemaValidator |
( |
Schema * | schema | ) |
|
|
explicit |
Create a schema validator.
- Parameters
-
schema | A pointer to the XML schema to use when validating XML documents. 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. |
- Deprecated
- Use XsdValidator instead.
◆ ~SchemaValidator()
LIBXMLPP_API xmlpp::SchemaValidator::~SchemaValidator |
( |
| ) |
|
|
override |
◆ get_schema() [1/2]
LIBXMLPP_API Schema * xmlpp::SchemaValidator::get_schema |
( |
| ) |
|
◆ get_schema() [2/2]
LIBXMLPP_API const Schema * xmlpp::SchemaValidator::get_schema |
( |
| ) |
const |
◆ initialize_valid()
LIBXMLPP_API void xmlpp::SchemaValidator::initialize_valid |
( |
| ) |
|
|
overrideprotectedvirtual |
◆ operator bool()
LIBXMLPP_API xmlpp::SchemaValidator::operator bool |
( |
| ) |
const |
◆ parse_context()
LIBXMLPP_API void xmlpp::SchemaValidator::parse_context |
( |
_xmlSchemaParserCtxt * | context | ) |
|
|
protected |
◆ parse_document()
virtual LIBXMLPP_API void xmlpp::SchemaValidator::parse_document |
( |
Document & | document | ) |
|
|
virtual |
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. |
- Note
- The document may be modified during the parsing process.
- Exceptions
-
- Deprecated
- Use XsdValidator::parse_document() instead.
◆ parse_file()
virtual LIBXMLPP_API void xmlpp::SchemaValidator::parse_file |
( |
const Glib::ustring & | filename | ) |
|
|
virtual |
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
-
- Deprecated
- Use XsdValidator::parse_file() instead.
◆ parse_memory()
virtual LIBXMLPP_API void xmlpp::SchemaValidator::parse_memory |
( |
const Glib::ustring & | contents | ) |
|
|
virtual |
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
-
- Deprecated
- Use XsdValidator::parse_memory() instead.
◆ release_underlying()
LIBXMLPP_API void xmlpp::SchemaValidator::release_underlying |
( |
| ) |
|
|
overrideprotectedvirtual |
◆ set_schema()
virtual LIBXMLPP_API void xmlpp::SchemaValidator::set_schema |
( |
Schema * | schema | ) |
|
|
virtual |
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 XML schema to use when validating XML documents. 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. |
- Deprecated
- Use XsdValidator::set_schema() instead.
◆ validate() [1/2]
LIBXMLPP_API bool xmlpp::SchemaValidator::validate |
( |
const Document * | doc | ) |
|
◆ validate() [2/2]
LIBXMLPP_API bool xmlpp::SchemaValidator::validate |
( |
const Glib::ustring & | file | ) |
|
◆ ctxt_
_xmlSchemaValidCtxt* xmlpp::SchemaValidator::ctxt_ |
|
protected |
◆ embbeded_shema_
bool xmlpp::SchemaValidator::embbeded_shema_ |
|
protected |
◆ schema_
Schema* xmlpp::SchemaValidator::schema_ |
|
protected |