XML DTD validator.
More...
#include <libxml++/validators/dtdvalidator.h>
XML DTD validator.
DTD = Document Type Definition
xmlpp::DtdValidator::DtdValidator |
( |
| ) |
|
xmlpp::DtdValidator::DtdValidator |
( |
const std::string & |
filename | ) |
|
|
explicit |
Create a validator and parse an external subset (DTD file) immediately.
- Parameters
-
filename | The URL of the DTD. |
- Exceptions
-
Create a validator and parse an external subset (DTD file) immediately.
- Parameters
-
external | The external ID of the DTD. |
system | The URL of the DTD. |
- Exceptions
-
xmlpp::DtdValidator::DtdValidator |
( |
Dtd* |
dtd, |
|
|
bool |
take_ownership |
|
) |
| |
|
explicit |
Create a validator.
- Since libxml++ 3.0:
- Parameters
-
dtd | A pointer to the DTD to use when validating XML documents. |
take_ownership | If true , the validator takes ownership of the DTD. The caller must not delete it.
If false , the validator does not take ownership of the DTD. The caller must guarantee that the DTD exists as long as the validator keeps a pointer to it. The caller is responsible for deleting the DTD when it's no longer needed. |
xmlpp::DtdValidator::~DtdValidator |
( |
| ) |
|
|
override |
Dtd* xmlpp::DtdValidator::get_dtd |
( |
| ) |
|
Get the parsed DTD.
- Returns
- A pointer to the parsed DTD, or
0
.
const Dtd* xmlpp::DtdValidator::get_dtd |
( |
| ) |
const |
Get the parsed DTD.
- Returns
- A pointer to the parsed DTD, or
0
.
void xmlpp::DtdValidator::initialize_context |
( |
| ) |
|
|
overrideprotectedvirtual |
xmlpp::DtdValidator::operator bool |
( |
| ) |
const |
|
explicitoverridevirtualnoexcept |
Test whether a DTD has been parsed.
For instance
if (validator)
do_something();
Implements xmlpp::Validator.
void xmlpp::DtdValidator::parse_file |
( |
const std::string & |
filename | ) |
|
|
overridevirtual |
Parse an external subset (DTD file).
If the validator already contains a DTD, that DTD is deleted.
- Parameters
-
filename | The URL of the DTD. |
- Exceptions
-
Implements xmlpp::Validator.
void xmlpp::DtdValidator::parse_memory |
( |
const Glib::ustring & |
contents | ) |
|
|
overridevirtual |
Parse a DTD from a string.
If the validator already contains a DTD, that DTD is deleted.
- Parameters
-
contents | The DTD as a string. |
- Exceptions
-
Implements xmlpp::Validator.
Parse a DTD from a stream.
If the validator already contains a DTD, that DTD is deleted.
- Parameters
-
- Exceptions
-
Parse an external subset (DTD file).
If the validator already contains a DTD, that DTD is deleted.
- Parameters
-
external | The external ID of the DTD. |
system | The URL of the DTD. |
- Exceptions
-
void xmlpp::DtdValidator::release_underlying |
( |
| ) |
|
|
overrideprotectedvirtual |
void xmlpp::DtdValidator::set_dtd |
( |
Dtd* |
dtd, |
|
|
bool |
take_ownership |
|
) |
| |
Set a DTD.
If the validator already contains a DTD, that DTD is released (deleted if the validator owns the DTD).
- Parameters
-
dtd | A pointer to the DTD to use when validating XML documents. |
take_ownership | If true , the validator takes ownership of the DTD. The caller must not delete it.
If false , the validator does not take ownership of the DTD. The caller must guarantee that the DTD exists as long as the validator keeps a pointer to it. The caller is responsible for deleting the DTD when it's no longer needed. |
void xmlpp::DtdValidator::validate |
( |
const Document* |
document | ) |
|
|
overridevirtual |
Validate a document, using a previously parsed DTD.
The internal subset (if present) is de-coupled (i.e. not used), which could give problems if ID or IDREF is present.
- Parameters
-
document | Pointer to the document. |
- Exceptions
-
Implements xmlpp::Validator.