libxml++  3.2.3
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

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

Protected Member Functions

LIBXMLPP_API void parse_context (_xmlRelaxNGParserCtxt* context)
 
LIBXMLPP_API void release_underlying ()
 
- Protected Member Functions inherited from xmlpp::NonCopyable
 NonCopyable () noexcept
 
 NonCopyable (const NonCopyable&)=delete
 
 NonCopyable (NonCopyable&&)=delete
 
virtual ~NonCopyable ()
 
NonCopyableoperator= (const NonCopyable&)=delete
 
NonCopyableoperator= (NonCopyable&&)=delete
 

Detailed Description

Represents a RelaxNG schema for validating XML files.

RelaxNG = REgular LAnguage for XML Next Generation

Since libxml++ 2.38:

Constructor & Destructor Documentation

◆ RelaxNGSchema() [1/4]

LIBXMLPP_API xmlpp::RelaxNGSchema::RelaxNGSchema ( )

◆ RelaxNGSchema() [2/4]

LIBXMLPP_API 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.

◆ RelaxNGSchema() [3/4]

LIBXMLPP_API xmlpp::RelaxNGSchema::RelaxNGSchema ( const std::string &  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

◆ RelaxNGSchema() [4/4]

LIBXMLPP_API 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

◆ ~RelaxNGSchema()

LIBXMLPP_API xmlpp::RelaxNGSchema::~RelaxNGSchema ( )
override

Member Function Documentation

◆ cobj() [1/2]

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

Access the underlying libxml implementation.

◆ cobj() [2/2]

LIBXMLPP_API _xmlRelaxNG* xmlpp::RelaxNGSchema::cobj ( )
noexcept

Access the underlying libxml implementation.

◆ parse_context()

LIBXMLPP_API void xmlpp::RelaxNGSchema::parse_context ( _xmlRelaxNGParserCtxt *  context)
protected

◆ parse_document()

LIBXMLPP_API void xmlpp::RelaxNGSchema::parse_document ( const Document document)
overridevirtual

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.

◆ parse_file()

LIBXMLPP_API void xmlpp::RelaxNGSchema::parse_file ( const std::string &  filename)
overridevirtual

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.

◆ parse_memory()

LIBXMLPP_API void xmlpp::RelaxNGSchema::parse_memory ( const Glib::ustring &  contents)
overridevirtual

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.

◆ release_underlying()

LIBXMLPP_API void xmlpp::RelaxNGSchema::release_underlying ( )
protected