Validator for XML files.
More...
#include <OpenMS/FORMAT/VALIDATORS/XMLValidator.h>
|
| | XMLValidator () |
| | Constructor.
|
| |
| bool | isValid (const std::string &filename, const std::string &schema, std::ostream &os=std::cerr) |
| | Returns if an XML file is valid for given a schema file.
|
| |
|
| void | logError_ (const std::string &kind, const std::string &message, unsigned long line, unsigned long column) |
| |
|
| bool | valid_ |
| | Flag if the validated file is valid.
|
| |
| std::string | filename_ |
| | File name of validated file (for error messages)
|
| |
| std::ostream * | os_ |
| |
Validator for XML files.
Validates an XML file against a given schema.
◆ XMLValidator()
◆ isValid()
| bool isValid |
( |
const std::string & |
filename, |
|
|
const std::string & |
schema, |
|
|
std::ostream & |
os = std::cerr |
|
) |
| |
Returns if an XML file is valid for given a schema file.
Error messages are printed to the error stream, unless redirected with the attribute os .
- Parameters
-
| [in] | filename | The file to validated. |
| [in] | schema | The filename of the schema that should be used for validation. |
| [in] | os | The stream where error messages should be send to. |
- Exceptions
-
◆ logError_()
| void logError_ |
( |
const std::string & |
kind, |
|
|
const std::string & |
message, |
|
|
unsigned long |
line, |
|
|
unsigned long |
column |
|
) |
| |
|
protected |
Record a validation problem. Called by the internal Xerces ErrorHandler bridge (defined in the .cpp); keeps Xerces out of this public header.
◆ XMLValidatorErrorHandler_
| friend class XMLValidatorErrorHandler_ |
|
friend |
The internal Xerces ErrorHandler bridge needs access to logError_.
◆ filename_
File name of validated file (for error messages)
◆ os_
◆ valid_
Flag if the validated file is valid.