Platforms to show: All Mac Windows Linux Cross-Platform

Back to SchemaValidatorMBS class.

SchemaValidatorMBS.AddParameters(values as Dictionary)

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Saxon MBS XML Plugin 25.0 ✅ Yes ✅ Yes ✅ Yes ❌ No All
Sets parameters given values in the dictionary.

This is a convenience function.
We loop over the entries in the dictionary, convert keys to XdmAtomicValue and values XdmValue objects internally and set parameters.

SchemaValidatorMBS.AddProperties(values as Dictionary)

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Saxon MBS XML Plugin 25.0 ✅ Yes ✅ Yes ✅ Yes ❌ No All
Sets properties given values in the dictionary.

This is a convenience function.
We loop over the entries in the dictionary, convert keys and values to string and set properties.

SchemaValidatorMBS.clearParameters

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Saxon MBS XML Plugin 25.0 ✅ Yes ✅ Yes ✅ Yes ❌ No All
Clear parameter values set.

SchemaValidatorMBS.clearProperties

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Saxon MBS XML Plugin 25.0 ✅ Yes ✅ Yes ✅ Yes ❌ No All
Clears all properties.

SchemaValidatorMBS.Constructor

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Saxon MBS XML Plugin 25.0 ✅ Yes ✅ Yes ✅ Yes ❌ No All
Default constructor.

See also:

SchemaValidatorMBS.Constructor(other as SchemaValidatorMBS)

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Saxon MBS XML Plugin 25.0 ✅ Yes ✅ Yes ✅ Yes ❌ No All
The copy constructor.

See also:

SchemaValidatorMBS.Constructor(SaxonProcessor as SaxonProcessorMBS, CWD as String = "")

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Saxon MBS XML Plugin 25.0 ✅ Yes ✅ Yes ✅ Yes ❌ No All
A constructor with a SaxonProcessor.

The supplied processor should have license flag set to true for the Schema Validator to operate.

SaxonProcessor: the SaxonProcessor
cwd: set the current working directory

See also:

SchemaValidatorMBS.Destructor

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Saxon MBS XML Plugin 25.0 ✅ Yes ✅ Yes ✅ Yes ❌ No All
The destructor.

SchemaValidatorMBS.exportSchema(File as FolderItem)

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Saxon MBS XML Plugin 25.0 ✅ Yes ✅ Yes ✅ Yes ❌ No All
Export a precompiled Schema Component Model containing all the components (except built-in components) that have been loaded by using the register methods.

See also:

SchemaValidatorMBS.exportSchema(Path as String)

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Saxon MBS XML Plugin 25.0 ✅ Yes ✅ Yes ✅ Yes ❌ No All
Export a precompiled Schema Component Model containing all the components (except built-in components) that have been loaded by using the register methods.

Path: The file name where the exported schema will be stored

See also:

SchemaValidatorMBS.ParameterValue(name as String) as XdmValueMBS

Type Topic Plugin Version macOS Windows Linux iOS Targets
property Saxon MBS XML Plugin 25.0 ✅ Yes ✅ Yes ✅ Yes ❌ No All
Get/Set a parameter.

Name: The name of the parameter, as a string.
For namespaced parameter use the JAXP solution i.e. "{uri}name" value of the query parameter.
Assign "" to clear a previously set value.

Some of the properties on this class may just internally set/get a parameter.
(Read and Write computed property)

SchemaValidatorMBS.PropertyValue(name as String) as String

Type Topic Plugin Version macOS Windows Linux iOS Targets
property Saxon MBS XML Plugin 25.0 ✅ Yes ✅ Yes ✅ Yes ❌ No All
A property specific to the processor in use.
Example
var s as SchemaValidatorMBS // your validator

// enable reporting of errors.
s.PropertyValue("report-node") = "true"

Some of the properties on this class may just internally set/get a property.
(Read and Write computed property)

SchemaValidatorMBS.registerSchemaFromFile(File as FolderItem)

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Saxon MBS XML Plugin 25.0 ✅ Yes ✅ Yes ✅ Yes ❌ No All
Register the schema from file name.

The schema components derived from this schema document are added to the cache of schema components maintained by this SchemaManager.

Raises exception if parsing schema fails.

SchemaValidatorMBS.registerSchemaFromNode(node as XdmNodeMBS)

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Saxon MBS XML Plugin 25.0 ✅ Yes ✅ Yes ✅ Yes ❌ No All
Register the schema supplied as an XDM Node Object.

node: The schema document supplied as an XdmNode object

Raises exception if parsing schema fails.

SchemaValidatorMBS.registerSchemaFromPath(Path as String)

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Saxon MBS XML Plugin 25.0 ✅ Yes ✅ Yes ✅ Yes ❌ No All
Register the schema from file name.

The schema components derived from this schema document are added to the cache of schema components maintained by this SchemaManager.

Path: File name of the schema relative to the cwd or full path if cwd is "". The document may be either a schema document in source XSD format, or a compiled schema in Saxon-defined SCM format (as produced using the method exportSchema)

Raises exception if parsing schema fails.

SchemaValidatorMBS.registerSchemaFromString(schemaStr as String, systemID as String = "")

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Saxon MBS XML Plugin 25.0 ✅ Yes ✅ Yes ✅ Yes ❌ No All
Register the schema supplied as a string.
Example
Var processor As New SaxonProcessorMBS
Var validator As SchemaValidatorMBS = processor.NewSchemaValidator

Var SchemaXML As String = _
"<?xml version=""1.0"" encoding=""UTF-8""?>" + EndOfLine + _
"<xs:schema xmlns:xs=""http://www.w3.org/2001/XMLSchema"" elementFormDefault=""qualified"" attributeFormDefault=""unqualified"">" + EndOfLine + _
" <xs:element name=""request"">" + EndOfLine + _
" <xs:complexType>" + EndOfLine + _
" <xs:sequence>" + EndOfLine + _
" <xs:element name=""a"" type=""xs:string""/>" + EndOfLine + _
" <xs:element name=""b"" type=""xs:string""/>" + EndOfLine + _
" </xs:sequence>" + EndOfLine + _
" <xs:assert test=""count(child::node()) = 3""/>" + EndOfLine + _
" </xs:complexType>" + EndOfLine + _
" </xs:element>" + EndOfLine + _
"</xs:schema>"

validator.registerSchemaFromString SchemaXML

schemaStr: The schema document supplied as a string.
systemID: The system ID of the document supplied as a string.

Raises exception if parsing schema fails.

Some examples using this method:

SchemaValidatorMBS.removeParameter(name as String) as Boolean

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Saxon MBS XML Plugin 25.0 ✅ Yes ✅ Yes ✅ Yes ❌ No All
Remove a parameter (name, value) pair.

Please pass the name of the parameter.
Returns outcome of the removal, true if found.

SchemaValidatorMBS.validate

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Saxon MBS XML Plugin 25.0 ✅ Yes ✅ Yes ✅ Yes ❌ No All
Validate an instance document by a registered schema.

Source must be provided with SourceNode property or other way.

See also:

SchemaValidatorMBS.validate(sourceFile as FolderItem)

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Saxon MBS XML Plugin 25.0 ✅ Yes ✅ Yes ✅ Yes ❌ No All
Validate an instance document by a registered schema.

sourceFile: Name of the file to be validated.
Allows nil when source document is supplied with other method.

See also:

SchemaValidatorMBS.validate(sourcePath as String)

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Saxon MBS XML Plugin 25.0 ✅ Yes ✅ Yes ✅ Yes ❌ No All
Validate an instance document by a registered schema.

sourcePath: Name of the file to be validated.
Allows "" when source document is supplied with other method.

See also:

SchemaValidatorMBS.validateToNode(sourceFile as String = "") as XdmNodeMBS

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Saxon MBS XML Plugin 25.0 ✅ Yes ✅ Yes ✅ Yes ❌ No All
Validate an instance document supplied as a Source object.

sourceFile: The name of the file to be validated. Default is "".

Returns the validated document returned to the calling program as XdmNodeMBS.

SchemaValidatorMBS.ValidationReport as XdmNodeMBS

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Saxon MBS XML Plugin 25.0 ✅ Yes ✅ Yes ✅ Yes ❌ No All
Get the Validation report.
Example
Var processor As New SaxonProcessorMBS
Var validator As SchemaValidatorMBS = processor.NewSchemaValidator

// enable reporting of errors.
validator.PropertyValue("report-node") = "true"

// validate something here

Var report As XdmNodeMBS = validator.ValidationReport
Var reportXML As String = report.toString
Var reportText As String = report.StringValue
break // see in debugger

The validation-report option must have been set to true in the properties to use this feature.

Returns nil if validation reporting feature has not been enabled.

The items on this page are in the following plugins: MBS XML Plugin.


The biggest plugin in space...