OpenStudio:utilities
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends Pages
List of all members
openstudio::XMLValidator Class Reference

#include <XMLValidator.hpp>

Public Member Functions

Getters
openstudio::path schemaPath () const
 
bool validate (const openstudio::path &xmlPath)
 
bool isValid () const
 
boost::optional< openstudio::pathxmlPath () const
 
std::vector< LogMessageerrors () const
 
std::vector< LogMessagewarnings () const
 
std::vector< LogMessagelogMessages () const
 
boost::optional< std::string > fullValidationReport () const
 Only applicable for Schematron validation. More...
 

Static Public Member Functions

Other
static openstudio::path schematronToXslt (const openstudio::path &schemaPath, const openstudio::path &outputDir)
 Static helper to convert a Schematron file to an XSLT StyleSheet. More...
 

Constructors

 XMLValidator (const openstudio::path &schemaPath)
 Constructor for a new validator. More...
 
static XMLValidator gbxmlValidator ()
 

Constructor & Destructor Documentation

openstudio::XMLValidator::XMLValidator ( const openstudio::path schemaPath)
explicit

Constructor for a new validator.

The schemaPath extension is used to determine the type of validation to perform:

  • *.xsd => XSD
  • *.xml or *.sct => Schematron (convert to XSLT then validate)
  • *.xslt => Schematron that is already transformed to an XSLT stylesheet

Member Function Documentation

std::vector<LogMessage> openstudio::XMLValidator::errors ( ) const
boost::optional<std::string> openstudio::XMLValidator::fullValidationReport ( ) const

Only applicable for Schematron validation.

static XMLValidator openstudio::XMLValidator::gbxmlValidator ( )
static
bool openstudio::XMLValidator::isValid ( ) const
std::vector<LogMessage> openstudio::XMLValidator::logMessages ( ) const
openstudio::path openstudio::XMLValidator::schemaPath ( ) const
static openstudio::path openstudio::XMLValidator::schematronToXslt ( const openstudio::path schemaPath,
const openstudio::path outputDir 
)
static

Static helper to convert a Schematron file to an XSLT StyleSheet.

bool openstudio::XMLValidator::validate ( const openstudio::path xmlPath)
std::vector<LogMessage> openstudio::XMLValidator::warnings ( ) const
boost::optional<openstudio::path> openstudio::XMLValidator::xmlPath ( ) const