libxml++: xmlpp::SchemaValidatorBase Class Reference

libxml++ 3.2.3

Public Member Functions | Protected Member Functions | List of all members
xmlpp::SchemaValidatorBase Class Referenceabstract

Base class for schema validators. More...

`#include <libxml++/validators/schemavalidatorbase.h>`

Inheritance diagram for xmlpp::SchemaValidatorBase:
[legend]

## Public Member Functions
LIBXMLPP_API | SchemaValidatorBase () noexcept
LIBXMLPP_API | ~SchemaValidatorBase () override
virtual LIBXMLPP_API | operator bool () const noexcept override=0
| Test whether a schema has been parsed. More...
virtual LIBXMLPP_API void | parse_document (const Document* document)=0
| Parse a schema definition from a document. More...
LIBXMLPP_API void | parse_file (const std::string& filename) override=0
| Parse a schema definition file. More...
LIBXMLPP_API void | parse_memory (const Glib::ustring& contents) override=0
| Parse a schema definition from a string. More...
LIBXMLPP_API void | validate (const Document* document) override=0
| Validate a document, using a previously parsed schema. More...
virtual LIBXMLPP_API void | validate (const std::string& filename)=0
| Validate an XML file, using a previously parsed schema. More...
Public Member Functions inherited from xmlpp::Validator
LIBXMLPP_API | Validator () noexcept
LIBXMLPP_API | ~Validator () override

## Protected Member Functions
LIBXMLPP_API void | initialize_context () override
LIBXMLPP_API void | release_underlying () override
Protected Member Functions inherited from xmlpp::Validator
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. More...
virtual LIBXMLPP_API void | on_validity_error (const Glib::ustring& message)
virtual LIBXMLPP_API void | on_validity_warning (const Glib::ustring& message)
Protected Member Functions inherited from xmlpp::NonCopyable
| NonCopyable () noexcept
| NonCopyable (const NonCopyable&)=delete
| NonCopyable (NonCopyable&&)=delete
virtual | ~NonCopyable ()
NonCopyable& | operator= (const NonCopyable&)=delete
NonCopyable& | operator= (NonCopyable&&)=delete

## Additional Inherited Members
Static Protected Member Functions inherited from xmlpp::Validator
static LIBXMLPP_API void | callback_validity_error (void* ctx, const char* msg,...)
static LIBXMLPP_API void | callback_validity_warning (void* ctx, const char* msg,...)
Protected Attributes inherited from xmlpp::Validator
std::unique_ptr< exception > | exception_
Glib::ustring | validate_error_
Glib::ustring | validate_warning_

## Detailed Description

Base class for schema validators.

Since libxml++ 2.38:

## Constructor & Destructor Documentation

## ◆ SchemaValidatorBase()

LIBXMLPP_API xmlpp::SchemaValidatorBase::SchemaValidatorBase | ( |  | ) |
| noexcept

## ◆ ~SchemaValidatorBase()

LIBXMLPP_API xmlpp::SchemaValidatorBase::~SchemaValidatorBase | ( |  | ) |
| override

## Member Function Documentation

## ◆ initialize_context()

LIBXMLPP_API void xmlpp::SchemaValidatorBase::initialize_context | ( |  | ) |
| overrideprotectedvirtual

Reimplemented from xmlpp::Validator.

Reimplemented in xmlpp::XsdValidator.

## ◆ operator bool()

virtual LIBXMLPP_API xmlpp::SchemaValidatorBase::operator bool | ( |  | ) | const
| explicitoverridepure virtualnoexcept

Test whether a schema has been parsed.

For instance

if (validator)
do_something();

Implements xmlpp::Validator.

Implemented in xmlpp::XsdValidator, and xmlpp::RelaxNGValidator.

## ◆ parse_document()

virtual LIBXMLPP_API void xmlpp::SchemaValidatorBase::parse_document | ( | const Document* | document | ) |
| pure 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.

Exceptions

  xmlpp::parse_error |

Implemented in xmlpp::XsdValidator, and xmlpp::RelaxNGValidator.

## ◆ parse_file()

LIBXMLPP_API void xmlpp::SchemaValidatorBase::parse_file | ( | const std::string & | filename | ) |
| overridepure 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

  xmlpp::parse_error |

Implements xmlpp::Validator.

Implemented in xmlpp::XsdValidator, and xmlpp::RelaxNGValidator.

## ◆ parse_memory()

LIBXMLPP_API void xmlpp::SchemaValidatorBase::parse_memory | ( | const Glib::ustring & | contents | ) |
| overridepure 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

  xmlpp::parse_error |

Implements xmlpp::Validator.

Implemented in xmlpp::XsdValidator, and xmlpp::RelaxNGValidator.

## ◆ release_underlying()

LIBXMLPP_API void xmlpp::SchemaValidatorBase::release_underlying | ( |  | ) |
| overrideprotectedvirtual

Reimplemented from xmlpp::Validator.

Reimplemented in xmlpp::XsdValidator.

## ◆ validate() [1/2]

LIBXMLPP_API void xmlpp::SchemaValidatorBase::validate | ( | const Document* | document | ) |
| overridepure virtual

Validate a document, using a previously parsed schema.

Parameters

  document | Pointer to the document.

Exceptions

  xmlpp::internal_error |
  xmlpp::validity_error |

Implements xmlpp::Validator.

Implemented in xmlpp::XsdValidator, and xmlpp::RelaxNGValidator.

## ◆ validate() [2/2]

virtual LIBXMLPP_API void xmlpp::SchemaValidatorBase::validate | ( | const std::string & | filename | ) |
| pure virtual

Validate an XML file, using a previously parsed schema.

Parameters

  filename | The URL of the XML file.

Exceptions

  xmlpp::internal_error |
  xmlpp::parse_error |
  xmlpp::validity_error |

Implemented in xmlpp::XsdValidator, and xmlpp::RelaxNGValidator.