Altova StyleVision 2023 Enterprise Edition

An SPS can have multiple schema sources, where a schema could be a DTD or XML Schema on which an XML document is based, or an XML Schema that is generated from a DB and on which the DB is based.

 

In each SPS, there is one main schema, and, optionally, one or more additional schemas. When you add a new schema source, StyleVision automatically declares a parameter for that schema and assigns the parameter a value that is the URI of the Working XML File you assign to that schema. In the case of DBs, StyleVision generates a temporary XML file from the DB, and sets the parameter to target the document node of this temporary XML file.

 

Referencing parameters for sources

Each SPS parameter for a schema source addresses the document node of an XML file corresponding to that schema. In StyleVision, the XML file for each schema is the Working XML File or the XML file generated from a DB. SPS parameters for sources can therefore be used in two ways:

 

1.In XPath expressions within the SPS, to locate nodes in various documents. The parameter is used to identify the document, and subsequent locator steps in the XPath expression locate the required node within that document. For example, the expression: count(\$XML2//Department/Employee) returns the number of Employee elements in all Department elements in the XML document that is the Working XML File assigned to the schema source designated \$XML2.

2.On the command line, the URI of another XML file can be passed as the value of an SPS parameter for sources. Of course, the new XML file would have to be based on the schema represented by that parameter. For example, if FileA.xml and FileB.xml are both valid according to the same schema, and FileA.xml is the Working XML File assigned to a schema \$XML3 used in an SPS, then when an XSLT transformation for that SPS is invoked from the command line, FileB.xml can be substituted for FileA.xml by using the parameter \$XML3="FileB.xml". You should also note that, on the command line, values should be entered for all SPS parameters for sources except the parameter for the main schema. The XML file corresponding to the main schema will be the entry point for the XSLT stylesheet, and will therefore be the XML file on which the transformation is run.

 

© 2017-2023 Altova GmbH