libxml++: xmlpp::Dtd Class Reference
Represents an XML DTD for validating XML files. More...
#include <libxml++/dtd.h>
Public Member Functions | |
Dtd () | |
Dtd (_xmlDtd* dtd, bool take_ownership=false) | |
Create a Dtd from the underlying libxml DTD element. More... | |
Dtd (const std::string& filename) | |
Create a Dtd and parse an external subset (DTD file) immediately. More... | |
Dtd (const ustring& external, const ustring& system) | |
Create a Dtd and parse an external subset (DTD file) immediately. More... | |
~Dtd () override | |
_xmlDtd* | cobj () noexcept |
Access the underlying libxml implementation. More... | |
const _xmlDtd* | cobj () const noexcept |
Access the underlying libxml implementation. More... | |
ustring | get_external_id () const |
ustring | get_name () const |
ustring | get_system_id () const |
void | parse_file (const std::string& filename) |
Parse an external subset (DTD file). More... | |
void | parse_memory (const ustring& contents) |
Parse a DTD from a string. More... | |
void | parse_stream (std::istream& in) |
Parse a DTD from a stream. More... | |
void | parse_subset (const ustring& external, const ustring& system) |
Parse an external subset (DTD file). More... | |
Protected Member Functions | |
void | release_underlying () |
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 |
Detailed Description
Represents an XML DTD for validating XML files.
DTD = Document Type Definition
Constructor & Destructor Documentation
xmlpp::Dtd::Dtd | ( | ) |
|
explicit |
Create a Dtd from the underlying libxml DTD element.
- Parameters
-
dtd A pointer to the libxml DTD element. take_ownership If true
, this Dtd instance takes ownership of the libxml DTD element. The caller must not delete it.
Iffalse
, this Dtd does not take ownership of the libxml DTD element. The caller must guarantee that the libxml DTD element exists as long as this Dtd keeps a pointer to it. The caller is responsible for deleting the libxml DTD element when it's no longer needed, unless it belongs to a Document, in which case it's deleted when the Document is deleted.
|
explicit |
Create a Dtd and parse an external subset (DTD file) immediately.
- Parameters
-
filename The URL of the DTD.
- Exceptions
-
xmlpp::parse_error
Create a Dtd and parse an external subset (DTD file) immediately.
- Parameters
-
external The external ID of the DTD. system The URL of the DTD.
- Exceptions
-
xmlpp::parse_error
|
override |
Member Function Documentation
|
noexcept |
Access the underlying libxml implementation.
|
noexcept |
Access the underlying libxml implementation.
ustring xmlpp::Dtd::get_external_id | ( | ) | const |
ustring xmlpp::Dtd::get_name | ( | ) | const |
ustring xmlpp::Dtd::get_system_id | ( | ) | const |
void xmlpp::Dtd::parse_file | ( | const std::string & | filename | ) |
Parse an external subset (DTD file).
If another DTD has been parsed before, that DTD is replaced by the new one (deleted if this Dtd owns it).
- Parameters
-
filename The URL of the DTD.
- Exceptions
-
xmlpp::parse_error
void xmlpp::Dtd::parse_memory | ( | const ustring& | contents | ) |
Parse a DTD from a string.
If another DTD has been parsed before, that DTD is replaced by the new one (deleted if this Dtd owns it).
- Parameters
-
contents The DTD as a string.
- Exceptions
-
xmlpp::parse_error
void xmlpp::Dtd::parse_stream | ( | std::istream & | in | ) |
Parse a DTD from a stream.
If another DTD has been parsed before, that DTD is replaced by the new one (deleted if this Dtd owns it).
- Parameters
-
in The stream.
- Exceptions
-
xmlpp::parse_error
Parse an external subset (DTD file).
If another DTD has been parsed before, that DTD is replaced by the new one (deleted if this Dtd owns it).
- Parameters
-
external The external ID of the DTD. system The URL of the DTD.
- Exceptions
-
xmlpp::parse_error
|
protected |