xmlwrapp Lightweight C++ XML parsing library

Public Member Functions | List of all members
xml::relaxng Class Reference

XML validator using RelaxNG. More...

`#include <relaxng.h>`

## Public Member Functions
| relaxng (const document &doc, error_handler &on_error=throw_on_error)
| Parses XML RelaxNG document and creates relaxng instance from it. More...
| ~relaxng ()
| Destructor. More...
bool | validate (const document &doc, error_handler &on_error=throw_on_error) const
| Validates the document doc against the relaxng. More...

## Detailed Description

XML validator using RelaxNG.

This class is used to validate documents against RelaxNG schemas expressed in XML syntax (compact RelaxNG syntax is not supported).

Since
  0.9.0

## Constructor & Destructor Documentation

## ◆ relaxng()

xml::relaxng::relaxng | ( | const document & | doc,
|  | error_handler & | on_error = `throw_on_error`
| ) |  |
| explicit

Parses XML RelaxNG document and creates relaxng instance from it.

Errors are handled by on_error handler; by default, xml::exception is thrown on errors. If there's a fatal error that prevents the relaxng from being loaded and the error handler doesn't throw an exception, the constructor will throw xml::exception anyway.

## ◆ ~relaxng()

xml::relaxng::~relaxng | ( |  | ) |

Destructor.

## Member Function Documentation

## ◆ validate()

bool xml::relaxng::validate | ( | const document & | doc,
|  | error_handler & | on_error = `throw_on_error`
| ) |  | const

Validates the document doc against the relaxng.

Errors are handled by on_error handler; by default, xml::exception is thrown on errors.

Returns
  `true` if the document is valid with regard to the relaxng, `false` otherwise.

The documentation for this class was generated from the following file:

- xmlwrapp/relaxng.h