Copyright © 2006 Crane Softwrights Ltd.
$Date: 2006/12/04 15:12:17 $(UTC)
Table of Contents
During the development of UBL 1.0, the Forms Presentation Subcommittee (FPSC, now renamed the Human Interface Subcommittee, or HISC) innovated the concept of an "XPath file" for the UBL document models.
XPath reports turn out to be very useful not only for document models, but also for XML instances. By dealing with the XPath report only for a given instance, one isn't distracted by the enumeration of all possible information items when only the information items at hand are of interest.
These are XSLT 1.0 stylesheets and example invocations shown are for Saxon 6.5.5 [Saxon].
The Crane-xml2xpath.xsl
stylesheet is invoked by an XSLT processor to produce a text result. An example invocation by Saxon is as follows:
saxon -o test.txt test.xml Crane-xml2xpath.xsl
The Crane-xml2xpath-html.xsl
stylesheet is invoked by an XSLT processor to produce an HTML result. An example invocation by Saxon is as follows:
saxon -o test.htm test.xml Crane-xml2xpath-html.xsl
Using stylesheet association [Assoc] and an XSLT-enabled web browser, it is possible to render an XPath report directly from the instance for which a report is needed.
With both the xml2xpath-html.xsl
and xml2xpath.xsl
stylesheet in the same directory as the XML instance, a stylesheet association processing instruction can be added to the instance, at the top of the file (but after the XML declaration if it is present) as follows:
<?xml-stylesheet type="text/xsl" href="Crane-xml2xpath-html.xsl"?>
Of course the href=
can be changed to a relative or absolute URL to point to these stylesheets found in any other directory.
The Crane-xml2xpath-instance.xsl
stylesheet is invoked by an XSLT processor to produce an XPath instance result having the identical structure as the input but with the content replaced by XPath reference numbers. An example invocation by Saxon is as follows:
saxon -o testout.xml test.xml Crane-xml2xpath-instance.xsl
[Assoc] James Clark Associating Style Sheets with XML documents Version 1.0 1999-06-29
[Saxon] Michael Kay Saxon