XML Schema Validator. More...
#include <libxml++/validators/schemavalidator.h>
Detailed Description
Constructor & Destructor Documentation
xmlpp::SchemaValidator::SchemaValidator |
( |
| ) |
|
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
-
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
-
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. |
virtual xmlpp::SchemaValidator::~SchemaValidator |
( |
| ) |
|
|
virtual |
Member Function Documentation
Schema* xmlpp::SchemaValidator::get_schema |
( |
| ) |
|
Get the parsed schema.
- Returns
- A pointer to the parsed schema, or
0
.
const Schema* xmlpp::SchemaValidator::get_schema |
( |
| ) |
const |
Get the parsed schema.
- Returns
- A pointer to the parsed schema, or
0
.
virtual void xmlpp::SchemaValidator::initialize_valid |
( |
| ) |
|
|
protectedvirtual |
xmlpp::SchemaValidator::operator bool |
( |
| ) |
const |
Test whether a schema has been parsed.
void xmlpp::SchemaValidator::parse_context |
( |
_xmlSchemaParserCtxt * |
context | ) |
|
|
protected |
virtual 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
-
virtual 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
-
file | The URL of the schema. |
- Exceptions
-
virtual 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
-
virtual void xmlpp::SchemaValidator::release_underlying |
( |
| ) |
|
|
protectedvirtual |
virtual 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. |
bool xmlpp::SchemaValidator::validate |
( |
const Document* |
doc | ) |
|
Validate a document, using a previously parsed schema.
- Parameters
-
doc | Pointer to the document. |
- Returns
- Whether the document is valid.
- Exceptions
-
bool xmlpp::SchemaValidator::validate |
( |
const Glib::ustring & |
file | ) |
|
Validate an XML file, using a previously parsed schema.
- Parameters
-
file | The URI of the XML file. |
- Returns
- Whether the document is valid.
- Exceptions
-
Member Data Documentation
_xmlSchemaValidCtxt* xmlpp::SchemaValidator::ctxt_ |
|
protected |
bool xmlpp::SchemaValidator::embbeded_shema_ |
|
protected |
Schema* xmlpp::SchemaValidator::schema_ |
|
protected |
The documentation for this class was generated from the following file:
- validators/schemavalidator.h