OpenStudio:utilities
Loading...
Searching...
No Matches
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.
 

Other

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

Constructors

 XMLValidator (const openstudio::path &schemaPath)
 Constructor for a new validator.
 
 ~XMLValidator ()
 
 XMLValidator (const XMLValidator &other)=default
 
 XMLValidator (XMLValidator &&other) noexcept=default
 
XMLValidatoroperator= (const XMLValidator &other)=default
 
XMLValidatoroperator= (XMLValidator &&other) noexcept=default
 
static XMLValidator gbxmlValidator (const VersionString &schemaVersion=VersionString(7, 3))
 
static XMLValidator bclXMLValidator (openstudio::BCLXMLType bclXMLType=openstudio::BCLXMLType::MeasureXML, const VersionString &schemaVersion=VersionString(3, 1))
 

Constructor & Destructor Documentation

◆ XMLValidator() [1/3]

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 *.sch => Schematron (convert to XSLT then validate)
  • *.xslt => Schematron that is already transformed to an XSLT stylesheet

◆ ~XMLValidator()

openstudio::XMLValidator::~XMLValidator ( )

◆ XMLValidator() [2/3]

openstudio::XMLValidator::XMLValidator ( const XMLValidator & other)
default

◆ XMLValidator() [3/3]

openstudio::XMLValidator::XMLValidator ( XMLValidator && other)
defaultnoexcept

Member Function Documentation

◆ bclXMLValidator()

static XMLValidator openstudio::XMLValidator::bclXMLValidator ( openstudio::BCLXMLType bclXMLType = openstudio::BCLXMLType::MeasureXML,
const VersionString & schemaVersion = VersionString(3, 1) )
static

◆ errors()

std::vector< LogMessage > openstudio::XMLValidator::errors ( ) const

◆ fullValidationReport()

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

Only applicable for Schematron validation.

◆ gbxmlValidator()

static XMLValidator openstudio::XMLValidator::gbxmlValidator ( const VersionString & schemaVersion = VersionString(7, 3))
static

◆ isValid()

bool openstudio::XMLValidator::isValid ( ) const

◆ logMessages()

std::vector< LogMessage > openstudio::XMLValidator::logMessages ( ) const

◆ operator=() [1/2]

XMLValidator & openstudio::XMLValidator::operator= ( const XMLValidator & other)
default

◆ operator=() [2/2]

XMLValidator & openstudio::XMLValidator::operator= ( XMLValidator && other)
defaultnoexcept

◆ schemaPath()

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

◆ schematronToXslt()

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.

◆ validate()

bool openstudio::XMLValidator::validate ( const openstudio::path & xmlPath)

◆ warnings()

std::vector< LogMessage > openstudio::XMLValidator::warnings ( ) const

◆ xmlPath()

boost::optional< openstudio::path > openstudio::XMLValidator::xmlPath ( ) const