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 | warning (const xercesc::SAXParseException &exception) override |
| |
| void | error (const xercesc::SAXParseException &exception) override |
| |
| void | fatalError (const xercesc::SAXParseException &exception) override |
| |
| void | resetErrors () override |
| |
|
| 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()
◆ error()
| void error |
( |
const xercesc::SAXParseException & |
exception | ) |
|
|
overrideprotected |
◆ fatalError()
| void fatalError |
( |
const xercesc::SAXParseException & |
exception | ) |
|
|
overrideprotected |
◆ 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
-
◆ resetErrors()
◆ warning()
| void warning |
( |
const xercesc::SAXParseException & |
exception | ) |
|
|
overrideprotected |
◆ filename_
File name of validated file (for error messages)
◆ os_
◆ valid_
Flag if the validated file is valid.