Validating XML input

Validating XML input
The StreamServer can be instructed to validate the XML input before processing the data. The input can be validated against a DTD or XSD (XML Schema).
Validating against DTDs
The <!DOCTYPE...> tag in the XML input determines which DTD to validate against. For example:
<!DOCTYPE Music SYSTEM "C:\DTDS\musichits.dtd">
Validating against XSDs
You can use an XSD mapping table to determine which XSD to validate against. See XSD mapping table.
You can also use the schema location attributes prefix:noNamespaceSchemaLocation or prefix:schemaLocation in any element. For example:
xsi:schemaLocation="C:\DTDS\musichits.xsd"
The schema location attributes have the namespace URI http://www.w3.org/2001/XMLSchema-instance.
See the W3C XML schema recommendation for more information.
Relative paths to DTDs and XSDs
The path to a DTD or XSD can be relative, for example <!DOCTYPE Music SYSTEM "musichits.dtd"> or xsi:schemaLocation="musichits.xsd". If the XML input is polled using HTTP(S) Poll input connectors, the path is relative to the polled server’s URL. For all other types of input connectors, the path is relative to the Project’s export directory.
Validation levels
There are five levels of validation. To select which level to use, you must:
1
2
On the Agent Settings tab, select Validation level and click OK.
 
XSD mapping table
An XSD mapping table contains namespace to schema location mappings.
namespace_URI   schema_location   load_option
namespace_URI
schema_location
load_option
Specifies when to load a schema. Can be either 0 or 1. If load_option is not specified, you must use the argument -xsdimport <0|1> to define when to load schemas.
Example 24
 
//!multicolumn!
http://www.streamserve.com/xsd/schema/one   schemaone.xsd     1
http://www.streamserve.com/xsd/schema/two   schematwo.xsd     0
http://foo.com                              ./grb/xsd001.xsd  1
 
If schema locations are specified both in the mapping table and by schema location attributes in the XML document (xsi:schemaLocation etc.), the following apply:
Sending error messages
You can create a Message that sends an error message each time a validation error occurs. See Creating an XMLIN validation error Message.
OpenText StreamServe 5.6 Updated: 2013-03-01