OTX Reference  
OpenTestSystem.Otx.Extensions.XML.Actions.ValidateXml Class Reference

Validates an XML file against the XML schema file specified within the XML document. More...

Inheritance diagram for OpenTestSystem.Otx.Extensions.XML.Actions.ValidateXml:
Inheritance graph

Public Attributes

StringVariable errorMessages
 Cardinality [0..1]
Error message if errors occurred during the validation. More...
 
EncodingTerm fallbackEncoding
 Cardinality [0..1]
Optional encoding value of the XML document (Default = "UTF-8"), if no encoding is described in the XML prolog or byte order mark (BOM). If the encoding is defined by the prolog or BOM, the <fallbackEncoding> shall be ignored. If an invalid encoding (BIN, OCT, HEX) is specified, an XmlFormatException shall be thrown. More...
 
BooleanVariable isValid
 Cardinality [1]
Variable indicating whether the validation has been successfully performed or not. In case no schema is available false will returned, with the error message stating that there is no XML schema available. More...
 
StringTerm path
 Cardinality [1]
The URI path to the file. The path shall be defined by a URI (see ISO 13209-2, Annex OTX home and URI recommendation). More...
 
- Public Attributes inherited from OpenTestSystem.Otx.Core.Actions.ActionRealisation
OtxLink validFor
 Cardinality [0..1]
Validity of ActionRealisation. More...
 

Detailed Description

Validates an XML file against the XML schema file specified within the XML document.

The ValidateXml activity validates an XML file against the XML schema file specified within the XML document. All relative paths to schemas (xsd files) inside the XML document should be relative path locations where the XML document is the base location.

Exceptions
Core.Exceptions.InvalidReferenceExceptionIf the file given by the path element or the schema specified in XML document is not available or not accessible.
Exceptions.XmlFormatExceptionIf an invalid encoding (BIN, OCT, HEX) is specified, or if one of the referenced schema files is not a valid XML schema.
Syntax
Xml.ValidateXml(StringTerm path, BooleanVariable isValid, StringVariable errorMessages = NULL, EncodingTerm fallbackEncoding = @Encoding:UTF-8);
Examples
// Local Declarations
Boolean IsValid1 = false;
String ErrorMessages1 = "";
// Flow
Xml.ValidateXml("XmlStorage/ValidateXml_TC01.xml", IsValid1, ErrorMessages1, @Encoding:UTF-8);

Member Data Documentation

◆ errorMessages

StringVariable OpenTestSystem.Otx.Extensions.XML.Actions.ValidateXml.errorMessages

Cardinality [0..1]
Error message if errors occurred during the validation.

◆ fallbackEncoding

EncodingTerm OpenTestSystem.Otx.Extensions.XML.Actions.ValidateXml.fallbackEncoding

Cardinality [0..1]
Optional encoding value of the XML document (Default = "UTF-8"), if no encoding is described in the XML prolog or byte order mark (BOM). If the encoding is defined by the prolog or BOM, the <fallbackEncoding> shall be ignored. If an invalid encoding (BIN, OCT, HEX) is specified, an XmlFormatException shall be thrown.

◆ isValid

BooleanVariable OpenTestSystem.Otx.Extensions.XML.Actions.ValidateXml.isValid

Cardinality [1]
Variable indicating whether the validation has been successfully performed or not. In case no schema is available false will returned, with the error message stating that there is no XML schema available.

◆ path

StringTerm OpenTestSystem.Otx.Extensions.XML.Actions.ValidateXml.path

Cardinality [1]
The URI path to the file. The path shall be defined by a URI (see ISO 13209-2, Annex OTX home and URI recommendation).

OpenTestSystem.Otx.Extensions.XML.Actions.ValidateXml.path
StringTerm path
Cardinality [1] The URI path to the file. The path shall be defined by a URI (see ISO 13209-2,...
Definition: XML.cs:433
OpenTestSystem.Otx.Extensions.XML.Actions.ValidateXml.fallbackEncoding
EncodingTerm fallbackEncoding
Cardinality [0..1] Optional encoding value of the XML document (Default = "UTF-8"),...
Definition: XML.cs:463
OpenTestSystem.Otx.Extensions.XML.Actions.ValidateXml.isValid
BooleanVariable isValid
Cardinality [1] Variable indicating whether the validation has been successfully performed or not....
Definition: XML.cs:443
OpenTestSystem.Otx.Extensions.XML.Actions.ValidateXml.errorMessages
StringVariable errorMessages
Cardinality [0..1] Error message if errors occurred during the validation.
Definition: XML.cs:453