libxml++  2.38.0
Public Member Functions | Protected Member Functions | List of all members
xmlpp::RelaxNGSchema Class Reference

Represents a RelaxNG schema for validating XML files. More...

#include <libxml++/relaxngschema.h>

Inheritance diagram for xmlpp::RelaxNGSchema:
Inheritance graph
[legend]

Public Member Functions

 RelaxNGSchema ()
 
 RelaxNGSchema (_xmlRelaxNG* schema)
 Create a schema from the underlying libxml schema element. More...
 
 RelaxNGSchema (const Glib::ustring& filename)
 Create a schema from a schema definition file. More...
 
 RelaxNGSchema (const Document* document)
 Create a schema from an XML document. More...
 
virtual ~RelaxNGSchema ()
 
_xmlRelaxNG* cobj ()
 Access the underlying libxml implementation. More...
 
const _xmlRelaxNG* cobj () const
 Access the underlying libxml implementation. More...
 
virtual void parse_document (const Document* document)
 Parse a schema definition from a document. More...
 
virtual void parse_file (const Glib::ustring& filename)
 Parse a schema definition file. More...
 
virtual void parse_memory (const Glib::ustring& contents)
 Parse a schema definition from a string. More...
 
- Public Member Functions inherited from xmlpp::SchemaBase
 SchemaBase ()
 
virtual ~SchemaBase ()
 

Protected Member Functions

void parse_context (_xmlRelaxNGParserCtxt* context)
 
void release_underlying ()
 

Detailed Description

Represents a RelaxNG schema for validating XML files.

RelaxNG = REgular LAnguage for XML Next Generation

Since libxml++ 2.38:

Constructor & Destructor Documentation

xmlpp::RelaxNGSchema::RelaxNGSchema ( )
xmlpp::RelaxNGSchema::RelaxNGSchema ( _xmlRelaxNG *  schema)
explicit

Create a schema from the underlying libxml schema element.

Parameters
schemaA pointer to the libxml schema element. The RelaxNGSchema takes ownership of the _xmlRelaxNG. The caller must not deallocate it.
xmlpp::RelaxNGSchema::RelaxNGSchema ( const Glib::ustring filename)
explicit

Create a schema from a schema definition file.

The schema must be defined with XML syntax (.rng file). The compact syntax (.rnc file) is not supported.

Parameters
filenameThe URL of the schema.
Exceptions
xmlpp::parse_error
xmlpp::RelaxNGSchema::RelaxNGSchema ( const Document document)
explicit

Create a schema from an XML document.

Parameters
documentA preparsed document tree, containing the schema definition.
Exceptions
xmlpp::parse_error
virtual xmlpp::RelaxNGSchema::~RelaxNGSchema ( )
virtual

Member Function Documentation

_xmlRelaxNG* xmlpp::RelaxNGSchema::cobj ( )

Access the underlying libxml implementation.

const _xmlRelaxNG* xmlpp::RelaxNGSchema::cobj ( ) const

Access the underlying libxml implementation.

void xmlpp::RelaxNGSchema::parse_context ( _xmlRelaxNGParserCtxt *  context)
protected
virtual void xmlpp::RelaxNGSchema::parse_document ( const Document document)
virtual

Parse a schema definition from a document.

If another schema has been parsed before, that schema is replaced by the new one.

Parameters
documentA preparsed document tree, containing the schema definition.
Exceptions
xmlpp::parse_error

Implements xmlpp::SchemaBase.

virtual void xmlpp::RelaxNGSchema::parse_file ( const Glib::ustring filename)
virtual

Parse a schema definition file.

The schema must be defined with XML syntax (.rng file). The compact syntax (.rnc file) is not supported.

If another schema has been parsed before, that schema is replaced by the new one.

Parameters
filenameThe URL of the schema.
Exceptions
xmlpp::parse_error

Implements xmlpp::SchemaBase.

virtual void xmlpp::RelaxNGSchema::parse_memory ( const Glib::ustring contents)
virtual

Parse a schema definition from a string.

The schema must be defined with XML syntax. The compact syntax is not supported.

If another schema has been parsed before, that schema is replaced by the new one.

Parameters
contentsThe schema definition as a string.
Exceptions
xmlpp::parse_error

Implements xmlpp::SchemaBase.

void xmlpp::RelaxNGSchema::release_underlying ( )
protected