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::path > xmlPath () 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...
 
 ~XMLValidator ()
 
 XMLValidator (const XMLValidator &other)=default
 
 XMLValidator (XMLValidator &&other) noexcept=default
 
XMLValidatoroperator= (const XMLValidator &other)=default
 
XMLValidatoroperator= (XMLValidator &&other) noexcept=default
 
static XMLValidator gbxmlValidator ()
 
static XMLValidator bclXMLValidator (openstudio::BCLXMLType bclXMLType=openstudio::BCLXMLType::MeasureXML, const VersionString &schemaVersion=VersionString(3, 1))
 

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
openstudio::XMLValidator::~XMLValidator ( )
openstudio::XMLValidator::XMLValidator ( const XMLValidator other)
default
openstudio::XMLValidator::XMLValidator ( XMLValidator &&  other)
defaultnoexcept

Member Function Documentation

static XMLValidator openstudio::XMLValidator::bclXMLValidator ( openstudio::BCLXMLType  bclXMLType = openstudio::BCLXMLType::MeasureXML,
const VersionString schemaVersion = VersionString(3, 1) 
)
static
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
XMLValidator& openstudio::XMLValidator::operator= ( const XMLValidator other)
default
XMLValidator& openstudio::XMLValidator::operator= ( XMLValidator &&  other)
defaultnoexcept
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