xmlwrapp
Lightweight C++ XML parsing library
Public Member Functions | List of all members
xml::schema Class Reference

XML Schema. More...

#include <schema.h>

Public Member Functions

 schema (const document &doc, error_handler &on_error=throw_on_error)
 Parses XML Schema document and creates schema instance from it. More...
 
 ~schema ()
 Destructor. More...
 
bool validate (const document &doc, error_handler &on_error=throw_on_error) const
 Validates the document doc against the schema. More...
 

Detailed Description

XML Schema.

This class is used to validate documents against XML Schema.

Since
0.7.0

Constructor & Destructor Documentation

◆ schema()

xml::schema::schema ( const document doc,
error_handler on_error = throw_on_error 
)
explicit

Parses XML Schema document and creates schema 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 schema from being loaded and the error handler doesn't throw an exception, the constructor will throw xml::exception anyway.

◆ ~schema()

xml::schema::~schema ( )

Destructor.

Member Function Documentation

◆ validate()

bool xml::schema::validate ( const document doc,
error_handler on_error = throw_on_error 
) const

Validates the document doc against the schema.

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 schema, false otherwise.

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