Home  · Classes  · Annotated Classes  · Modules  · Members  · Namespaces  · Related Pages
Public Member Functions | Protected Attributes

XMLValidator Class Reference
[File IO]

Validator for XML files. More...

#include <OpenMS/FORMAT/VALIDATORS/XMLValidator.h>

Inheritance diagram for XMLValidator:
ErrorHandler

List of all members.

Public Member Functions

 XMLValidator ()
 Constructor.
bool isValid (const String &filename, const String &schema, std::ostream &os=std::cerr)
 Returns if an XML file is valid for given a schema file.

Protected Member Functions

Implementation of Xerces ErrorHandler methods

virtual void warning (const xercesc::SAXParseException &exception)
virtual void error (const xercesc::SAXParseException &exception)
virtual void fatalError (const xercesc::SAXParseException &exception)
virtual void resetErrors ()

Protected Attributes

bool valid_
 Flag if the validated file is valid.
String filename_
 File name of validated file (for error messages).
std::ostream * os_

Detailed Description

Validator for XML files.

Validates an XML file against a given schema.


Constructor & Destructor Documentation

XMLValidator (  ) 

Constructor.


Member Function Documentation

virtual void error ( const xercesc::SAXParseException &  exception  )  [protected, virtual]
virtual void fatalError ( const xercesc::SAXParseException &  exception  )  [protected, virtual]
bool isValid ( const String filename,
const 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 .

Exceptions:
Exception::FileNotFound is thrown if the file cannot be found
Exception::ParseError is thrown if the parser could not be initialized
virtual void resetErrors (  )  [protected, virtual]
virtual void warning ( const xercesc::SAXParseException &  exception  )  [protected, virtual]

Member Data Documentation

String filename_ [protected]

File name of validated file (for error messages).

std::ostream* os_ [protected]
bool valid_ [protected]

Flag if the validated file is valid.


OpenMS / TOPP release 1.10.0 Documentation generated on Thu Mar 7 2013 09:42:54 using doxygen 1.7.1