[Accessibility conventions are described at the bottom of the page]
7. XPath enumerations
[> 8.][< 6.1.3][^^^]
7.0 Exhaustive enumeration of information items
[> 7.1][> 8.][< 7.][^^][^^^]
Constraint expressions (as used in the UBL schemas) reveal only the parent/child relationship between information items
[[1] - one cannot readily tell the impact of the additional number of possible descendents being added to a given element when choosing
to include a particular child for that element
]
The complete ancestry of possible information items is only available through an analysis of the parent/child constraints
at every possible level of the document tree
[[1] - the UBL TC has performed the analysis and summarized all of the elements and attributes in all contexts of all document types
]
The information is made available in four forms of what the committee has termed "XPath files"
[[1] - a normative description in XML of all possible ancestral and descendent paths of an XML instance
[[2] - this description can be processed for analytical purposes
][1] - a simple text report of the absolute minimum set mandatory information items required to satisfy the document model
[1] - a simple text report of all possible information items defined by the document model use of elements
[1] - an exhaustive sample XML instance that can be processed by non-validating applications
]
Complete suite of XPath information created from the document models
[[1] - could be based on the regular nature of the W3C Schema XSD expressions
[1] - could be based on the model information of parent/child relationships
[1] - drawback of being very large files
[[2] - e.g. there are over 800,000 information items (not including recursion) in the UBL Order model
]]
Can also create XPath files from instances
[[1] - useful when working with a limited number of information items instead of an exhaustive enumeration
[1] - drawback of being fragile
[[2] - changing anything in the instance renumbers all reference numbers from that point to the end of the document
][1] - Crane has a number of XPath-related resources available in the "Free resources" section of the web site linked from the right-hand
marginalia of:
[[2] - [http://www.CraneSoftwrights.com/links/trn-20090212.htm]
]]
UBL XPath files are used in the creation of a number of related resources
[[1] - e.g. stylesheet development
]
7.1 Composition of XPath files
[> 8.][< 7.0][^^][^^^]
7.1.1 Cataloguing information items in context
[> 7.1.2][> 8.][< 7.0][^^][^^^]
W3C XML Path Language (XPath) 1.0 defines two specifications
[[1] - a data model for the information found in an XML document
[1] - a syntax for addressing components of the data model
[1] - [http://www.w3.org/TR/1999/REC-xpath-19991116]
]
XPath exposes only the information found in an XML document
[[1] - the syntax used to mark up the information in the document is not preserved nor represented in the data model
]
XPath defines only seven kinds of tree nodes in its data model
[[1] - root node (the parent of the document element node)
[[2] - the document element is the top-most (when thinking of a tree hierarchy) and the outer-most (when thinking of element wrapping)
element in the tree
][1] - element, attribute and text nodes (for information content)
[1] - namespace node (for rich labeling of element and attribute nodes)
[1] - comment and processing-instruction nodes (for document annotations)
]
XPath data model is different than the Document Object Model (DOM)
[[1] - the DOM data model for an XML document includes more syntactic information regarding the non-informational components of the
document
[[2] - e.g. use of CDATA sections and entity references are preserved in the DOM data model
][1] - the XPath data model for an XML document is agnostic to any choices of syntax made when expressing the information
[[2] - e.g. all CDATA sections and entity references are resolved and are not preserved in the XPath data model
]]
Basic use of XPath syntax is to reference the ancestry of an information item
[[1] - absolute XPath address to an element begins at outermost element (document element)
[[2] - /DocumentElement/ChildElement/GrandchildElement
][1] - relative XPath address to an element can begin anywhere in the document tree
[[2] - ParentElement/ChildElement
][1] - XPath address to all elements that are descendants (including children) of an ancestor
[[2] - AncestorElement//DescendentElement
][1] - XPath address to an attribute uses "@" as a distinction
[[2] - AttachedElement/@attributeName
][1] - XPath address to an attribute found attached to any element
[[2] - @attributeName
][1] - XPath address to all attributes attached to an ancestor or its descendants
[[2] - AncestorElement//@attributeName
]]
Using XPath syntax to address items can incorporate many aspects of nuance
[[1] - looking in different directions of the document tree from the current node
[1] - identifying nodes of different types along the directions
[1] - qualifying the nodes identified by boolean predicates as filters for rejecting unwanted nodes
[1] - Axis::NodeTest[boolean-predicate-1][boolean-predicate-2]
]
XPath typically used to find information in XML documents
[[1] - used by XSLT (the Extensible Stylesheet Language Transformations)
[[2] - [http://www.w3.org/TR/xslt]
[2] - [http://www.w3.org/TR/xslt20/]
[2] - publishing-oriented construction of new arrangements of structured information
][1] - used by XQuery (An XML Query Language)
[[2] - [http://www.w3.org/TR/xquery/]
[2] - data-oriented construction of new arrangements of structured information
][1] - used by XPointer (the XML Pointer Language)
[[2] - [http://www.w3.org/TR/xptr]
[2] - standalone specification for addressing pieces or portions of XML documents
]]
UBL uses the most minimal XPath addressing syntax to document a catalogue of element and attribute information items
[[1] - used in a descriptive manner rather than its designed use in an expositive manner
[1] - all location steps of a location path only address the nodes in the path
[[2] - steps do not utilize functions or predicates
[2] - only the child axis, with child:: omitted, is used in an element's location step
[2] - the "@" abbreviation is used for the attribute:: axis
][1] - both absolute and relative XPath addresses are used in various UBL support package files
[[2] - note that the use of white-space around information item names is arbitrary
[[3] - no white-space is used in the XPath files generated for UBL document models
[3] - white-space is used in this training material to make the lengthy addresses more readable within the confines of the page
margins
][2] - XPath text reports use only absolute XPath addresses
[[3] - UBL-2.0-20070414-XPath.zip - XPath files for UBL 2.0 models
[3] - example absolute addresses start at the root node and indicate the document element and then its descendent elements:
[[4] - /in:Invoice/cbc:IssueDate
/in:Invoice/cbc:IssueTime
/in:Invoice/cbc:InvoiceTypeCode
/in:Invoice/cac:InvoiceLine/cac:ItemInstance/
cbc:ProductTraceID
]][2] - XPath context reports use both absolute and relative XPath addresses
[[3] - UBL-2.0-20081231-clsupport.zip - code list support files for UBL 2.0
[3] - example relative addresses indicate an element that could be anywhere in the document and then its descendent elements:
[[4] - cac:SellersItemIdentification/cac:PhysicalAttribute/
cbc:PositionCode
cac:StandardItemIdentification/cac:PhysicalAttribute/
cbc:PositionCode
]]]]
7.1.2 Namespaces in XPath
[> 7.1.3][> 8.][< 7.1.1][^][^^][^^^]
XPath 1.0 has special considerations for namespaces
[[1] - the use of prefixes in XPath is independent of the use of prefixes in an instance being addressed
[1] - an instance may use the default namespace by specifying that no prefix for an element name is a proxy to a namespace URI string
[[2] - attributes without prefixes in instances are always in no namespace and not in the default namespace
][1] - an XPath location step addresses an element node or an attribute node either with or without a namespace prefix
[[2] - all XPath element and attribute names written without a prefix are, by definition, names in no namespace
[2] - the XPath name for an element or attribute in a given namespace must have a namespace prefix
][1] - XPath 2.0 adds to 1.0 the setting of the default namespace for un-prefixed element names
[[2] - [http://www.w3.org/TR/xpath20/]
]]
All UBL elements are in a namespace and all UBL attributes are in no namespace
[[1] - all element names must be prefixed in XPath addresses
[1] - all attribute names must not be prefixed in XPath addresses
[1] - XPath 2.0 default namespace is not used or assumed
]
7.1.3 XPath file XML vocabulary
[> 7.1.4][> 8.][< 7.1.2][^][^^][^^^]
The normative XPath file is an XML instance enumerating elements and attributes in context
[[1] - useful for programmatic analysis of document models that follow the UBL NDR
[[2] - not necessarily useful for models that contain choice groups or mixed content
][1] - this artefact is normative with respect to other XPath files, not with respect to UBL
]
<XPath>
[[1] - document element
[1] - id=
[[2] - identifier used for referencing this document in other contexts
]]
<Element>
[[1] - an element in context
[1] - name= and type=
[[2] - the element type, the type definition and the base type
][1] - restricts= and extends=
[[2] - data type derivations
][1] - uri= and prefix=
[[2] - namespace URI string and documentary prefix
][1] - minOccurs= and maxOccurs=
[[2] - cardinality
][1] - any=
[[2] - indication of unconstrained content
[2] - mutually exclusive with text= and loop=
][1] - text=
[[2] - indication of text content, not element content
[2] - mutually exclusive with any= and loop=
][1] - loop=
[[2] - indication, using its own name, of this element already being referenced in this element's ancestry (thus is an infinite loop)
[2] - mutually exclusive with any= and text=
]]
<Attribute>
[[1] - an attribute in context
[1] - name= and type=
[[2] - the attribute name and base type
][1] - use=
[[2] - cardinality
]]
Foreign elements and attributes
[[1] - any XPath element may contain attributes or child elements not defined by XPath, provided these constructs are not in the
XPath namespace
]
7.1.4 XPath text reports
[> 7.1.5][> 8.][< 7.1.3][^][^^][^^^]
The XPath text report is a human-legible summary for each information item:
[[1] - ordinal information item position as a reference number
[[2] - colloquially referred to as "the bang numbers" because of the use of exclamation marks surrounding them to distinguish them
in close proximity
[2] - ordinal element position
[2] - ordinal separator "."
[[3] - this is not to be interpreted as a decimal point
][2] - alphabetical ordinal attribute position within each element
[[3] - without zero fill
][2] - the ordinal pair "123.10" will follow "123.9" and be distinct from "123.1"
][1] - cardinality
[1] - absolute XPath location path address
]
[Example 7-1: 01 1 1..1 /in:Invoice/
02 2 0..1 /in:Invoice/ext:UBLExtensions/
03 3 1..n /in:Invoice/ext:UBLExtensions/ext:UBLExtension/
04 4 0..1 /in:Invoice/ext:UBLExtensions/ext:UBLExtension/cbc:ID
05 ...
06 17 1..1 /in:Invoice/cbc:ID
07 17.1 0..1 /in:Invoice/cbc:ID/@schemeAgencyID
08 17.2 0..1 /in:Invoice/cbc:ID/@schemeAgencyName
09 17.3 0..1 /in:Invoice/cbc:ID/@schemeDataURI
10 17.4 0..1 /in:Invoice/cbc:ID/@schemeID
11 17.5 0..1 /in:Invoice/cbc:ID/@schemeName
12 17.6 0..1 /in:Invoice/cbc:ID/@schemeURI
13 17.7 0..1 /in:Invoice/cbc:ID/@schemeVersionID
14 18 0..1 /in:Invoice/cbc:CopyIndicator
15 ...
16 20 1..1 /in:Invoice/cbc:IssueDate
17 21 0..1 /in:Invoice/cbc:IssueTime
18 ...
19 23 0..n /in:Invoice/cbc:Note
20 23.1 0..1 /in:Invoice/cbc:Note/@languageID
21 24 0..1 /in:Invoice/cbc:TaxPointDate
22 25 0..1 /in:Invoice/cbc:DocumentCurrencyCode
23 25.1 0..1 /in:Invoice/cbc:DocumentCurrencyCode/@languageID
24 25.2 0..1 /in:Invoice/cbc:DocumentCurrencyCode/@listAgencyID
25 25.3 0..1 /in:Invoice/cbc:DocumentCurrencyCode/@listAgencyName
26 25.4 0..1 /in:Invoice/cbc:DocumentCurrencyCode/@listID
27 25.5 0..1 /in:Invoice/cbc:DocumentCurrencyCode/@listName
28 25.6 0..1 /in:Invoice/cbc:DocumentCurrencyCode/@listSchemeURI
29 25.7 0..1 /in:Invoice/cbc:DocumentCurrencyCode/@listURI
30 25.8 0..1 /in:Invoice/cbc:DocumentCurrencyCode/@listVersionID
31 25.9 0..1 /in:Invoice/cbc:DocumentCurrencyCode/@name
32 ...
]
7.1.5 XPath reference numbers
[> 7.1.6][> 8.][< 7.1.4][^][^^][^^^]
Using the reference numbers is a concise way to represent long XPath addresses
[[1] - quicker to write
[1] - more room for more values
[1] - unambiguously identifies a location in an XML model or document
[1] - very fragile to model or document changes
]
Sample use of UBL 2.0 XPath Invoice reference numbers in a layout:
[Figure 7.1: Handwritten use of reference numbers
An image depicts the header information from the UN Layout Key rendering of the UBL 1.0 purchase order. In place of what would
be instance data from the purchase order are a number of handwritten XPath reference numbers.
]
7.1.6 XPath exhaustive instances
[> 7.1.7][> 8.][< 7.1.5][^][^^][^^^]
The XPath exhaustive instance is an XML document that instantiates one of every possible information item:
[[1] - impossible to validate because reference numbers do not satisfy data types
[1] - quite suitable for non-validating processes such as XSLT
]
[Example 7-2: 01 <in:Invoice xmlns:in="urn:...:Invoice-2"
02 xmlns:cac="urn:...:CommonAggregateComponents-2"
03 xmlns:cbc="urn:...:CommonBasicComponents-2"
04 xmlns:ext="urn:...:CommonExtensionComponents-2">
05 <ext:UBLExtensions>
06 <ext:UBLExtension>
07 <cbc:ID schemeAgencyID="!4.1!" schemeAgencyName="!4.2!"
08 schemeDataURI="!4.3!" schemeID="!4.4!" schemeName="!4.5!"
09 schemeURI="!4.6!" schemeVersionID="!4.7!">!4!</cbc:ID>
10 ...
11 <cbc:UBLVersionID schemeAgencyID="!14.1!" schemeAgencyName="!14.2!"
12 schemeDataURI="!14.3!" schemeID="!14.4!" schemeName="!14.5!"
13 schemeURI="!14.6!" schemeVersionID="!14.7!">!14!</cbc:UBLVersionID>
14 <cbc:CustomizationID schemeAgencyID="!15.1!"
15 schemeAgencyName="!15.2!" schemeDataURI="!15.3!" schemeID="!15.4!"
16 schemeName="!15.5!" schemeURI="!15.6!" schemeVersionID="!15.7!"
17 >!15!</cbc:CustomizationID>
18 <cbc:ProfileID schemeAgencyID="!16.1!" schemeAgencyName="!16.2!"
19 schemeDataURI="!16.3!" schemeID="!16.4!" schemeName="!16.5!"
20 schemeURI="!16.6!" schemeVersionID="!16.7!">!16!</cbc:ProfileID>
21 <cbc:ID schemeAgencyID="!17.1!" schemeAgencyName="!17.2!"
22 schemeDataURI="!17.3!" schemeID="!17.4!" schemeName="!17.5!"
23 schemeURI="!17.6!" schemeVersionID="!17.7!">!17!</cbc:ID>
24 <cbc:CopyIndicator>!18!</cbc:CopyIndicator>
25 <cbc:UUID schemeAgencyID="!19.1!" schemeAgencyName="!19.2!" schemeDataURI="!19.3!" schemeID="!19.4!" schemeName="!19.5!"
26 schemeURI="!19.6!" schemeVersionID="!19.7!">!19!</cbc:UUID>
27 <cbc:IssueDate>!20!</cbc:IssueDate>
28 <cbc:IssueTime>!21!</cbc:IssueTime>
29 <cbc:InvoiceTypeCode languageID="!22.1!" listAgencyID="!22.2!" listAgencyName="!22.3!" listID="!22.4!" listName="!22.5!"
30 listSchemeURI="!22.6!" listURI="!22.7!" listVersionID="!22.8!"
31 name="!22.9!">!22!</cbc:InvoiceTypeCode>
32 <cbc:Note languageID="!23.1!">!23!</cbc:Note>
33 <cbc:TaxPointDate>!24!</cbc:TaxPointDate>
34 <cbc:DocumentCurrencyCode languageID="!25.1!" listAgencyID="!25.2!" listAgencyName="!25.3!" listID="!25.4!" listName="!25.5!"
35 listSchemeURI="!25.6!" listURI="!25.7!" listVersionID="!25.8!" name="!25.9!">!25!</cbc:DocumentCurrencyCode> ...
]
(note the indentation of attributes and compression of namespace URI strings is documentary)
Using the XPath instance document for rendering will expose the bang numbers
[[1] - can use the handwritten version ([Figure 7.1]) for confirmation
]
Sample rendering of UBL 2.0 XPath instance to reveal the reference numbers:
[Figure 7.2: Stylesheet rendering of reference numbers
A screen shot depicts the header information from the UN Layout Key rendering of the UBL 1.0 purchase order. In place of what
would be instance data from the purchase order are a number of rendered XPath reference numbers.
]
7.1.7 XPath file normative content
[> 7.1.8][> 8.][< 7.1.6][^][^^][^^^]
The normative XPath XML file contains for each information item:
[[1] - name information
[1] - type base
[1] - cardinality
[1] - only normative in regard of XPath files, not in regard of the UBL delivery
]
[Example 7-3: 01 <XPath xmlns="urn:oasis:names:tc:ubl:schema:XPath-1.0"
02 id="urn:oasis:names:tc:ubl:XPath:Invoice-2.0">
03 <Namespace prefix="in" uri="urn:...:Invoice-2"/>
04 <Namespace prefix="cac" uri="urn:...:CommonAggregateComponents-2"/>
05 <Namespace prefix="cbc" uri="urn:...:CommonBasicComponents-2"/>
06 <Namespace prefix="ext" uri="urn:...:CommonExtensionComponents-2"/>
07 ...
08 <Element name="Invoice" type="InvoiceType"
09 prefix="in" minOccurs="1" maxOccurs="1">
10 <Element name="UBLExtensions" type="UBLExtensionsType"
11 prefix="ext" minOccurs="0" maxOccurs="1">
12 <Element name="UBLExtension" type="UBLExtensionType"
13 prefix="ext" minOccurs="1" maxOccurs="unbounded">
14 <Element name="ID" type="IDType"
15 extends="udt:IdentifierType"
16 prefix="cbc" minOccurs="0" maxOccurs="1" text="">
17 <Attribute name="schemeAgencyID" use="optional"
18 type="xsd:normalizedString"/>
19 ...
20 </Element>
21 ...
22 </Element>
23 </Element>
24 <Element name="UBLVersionID" type="UBLVersionIDType"
25 extends="udt:IdentifierType"
26 prefix="cbc" minOccurs="0" maxOccurs="1" text="">
27 <Attribute name="schemeAgencyID" use="optional"
28 type="xsd:normalizedString"/>
29 ...
30 </Element>
31 <Element name="CustomizationID" type="CustomizationIDType"
32 extends="udt:IdentifierType"
33 prefix="cbc" minOccurs="0" maxOccurs="1" text="">
34 ...
]
(note the indentation of attributes and compression of namespace URI strings is documentary)
7.1.8 XPath file collections
[> 7.1.9][> 8.][< 7.1.7][^][^^][^^^]
The XPath files are available in the committee repository
[[1] - [http://docs.oasis-open.org/ubl/submissions/XPath-files/]
[[2] - the XPath-files-readme.html index links to the files and the publicly-archived posts that describe the files
[2] - a local copy - 300Mb expanding to 8Gb:
[[3] - Crane/UBL/UBL-2.0-20070414-XPath.zip
]]]
For each document type, a number of XPath files are available:
[[1] - text/full/*-XPath.txt - full XPath report file
[[2] - every element and attribute information item is enumerated
][1] - text/minimal/*-Minimal-XPath.txt - minimal XPath report file
[[2] - only those mandatory element and information items that would make up a minimally-valid XPath instance are listed
[2] - the reference numbers shown are from the full XPath report file
][1] - xml/instance/*-Instance.xml - non-validated exhaustive instance
[[2] - a non-validating instance including one of every element and attribute information item
[2] - each item's content is the reference number enclosed in exclamation marks
][1] - xml/XPath/*-XPath.xml - normative XPath XML expression
[[2] - an XML instance enumerating every element and attribute in every possible context
[2] - suitable for processing by XML-based analysis tools
]]
The XPath normative XML document model is expressed using ISO/IEC 19757-2 RELAX-NG
[[1] - xpath.rnc
[1] - an approximation is expressed using W3C Schema
[[2] - xpath.xsd
][1] - a sample XSLT stylesheet illustrating the processing of an XPath file
[[2] - xpath.xsl
[2] - note that there are XSLT processors that cannot handle the magnitude of some of the XPath files even with this small stylesheet
[[3] - the limiting factor is the size of the source node tree created from the input XPath XML file
]]]
XPath files are used by the UBL TC for many purposes:
[[1] - initially developed only for their first purpose but then many new uses became evident
[1] - stylesheet implementation validation
[[2] - the HISC subcommittee innovated the XPath file concept for two purposes:
[[3] - business experts could specify the placement of UBL information items in a presented layout
[3] - stylesheet implementations could validate the placement of UBL information items in a presented layout
]][1] - code list contexts of use
[[2] - the UBL XPath files were integral in synthesizing the context files and resulting val/defaultCodeList.xsl stylesheet used in the UBL 2.0 specification
[2] - see [Chapter 8.] for overview
][1] - schema subset validation
[[2] - a customization methodology that utilizes XPath files is proposed for validating that the constraints of a customization do
not violate the constraints of UBL 2.0
[[3] - this is described in more detail in [Chapter 9.]
]][1] - Small Business Subset 1.0 specification
[[2] - version 1.0 of the UBL Small Business Subset was specified using XPath files
]]
7.1.9 Exhaustive XPath file drawbacks
[> 7.1.10][> 8.][< 7.1.8][^][^^][^^^]
File composition is a challenge for review and application processing
[[1] - line endings are linefeed characters (not carriage return characters)
[[2] - not suitable for Notepad application in Windows environments
][1] - some files are very large
[[2] - e.g. over 850Mb for the OrderResponse full text report file
][1] - in Windows environments the WordPad application accommodates both line end issues and file sizes
[[2] - but does so very slowly
]]
Tree-based XML processing paradigms may not be able to accommodate the magnitude of the normative XPath files
[[1] - the memory footprint of most tree-based XML processing approaches is a factor of the size of the XML document itself
[[2] - the larger the input XML document, the more memory is required to store the information
][1] - XSLT-based and DOM-based processors may have problems
[[2] - exceeding capacity limits
[[3] - the processor must have the resources to build an in-memory representation of the XML document
][2] - exceeding acceptability in performance
[[3] - the processor must take the time to build the in-memory representation of the XML document
][2] - some research is going into processors that have an external non-memory-based representation of the input document that is
suitable for processing
[2] - the memory footprint and processing speed of a SAX-based process is not a factor of the size of the XML document
[[3] - the XML document can be any size and the memory utilization is only a factor of the application's algorithm
[3] - an application need only maintain whatever information it wants to maintain as the XML document is processed
[3] - most of the committee XPath files were generated using the freely-available Python programming language and its SAX interface
to XML documents
[[4] - [http://www.python.org]
]]]]
Fragile to model changes
[[1] - XPath files are only useful as long as the document model does not change
[1] - any change to the document model will shift some of the numbers being used
[1] - always cite the version of the corresponding XPath file when citing reference numbers
]
7.1.10 XPath reports of arbitrary XML instances
[> 7.1.11][> 8.][< 7.1.9][^][^^][^^^]
A smaller XPath report, based on an arbitrary XML instance, is also very useful
[[1] - one might create an XML instance of a UBL document and need to summarize or talk about the information items in the instance
[1] - unlike the XPath file for a document model revealing all possible items of all possible instances, the XPath file for a given
instance reveals only the information items found in the instance
]
Crane has released XSLT stylesheets to create XPath reports of XML instances
[[1] - found online at [http://www.CraneSoftwrights.com/links/trn-20090212.htm]
[[2] - go to the "Free resources" link in the right-hand marginalia
[2] - go to the "UBL, XPath and Code List" page linked from the first section
[2] - go to the "XPath file resources" section
[2] - download the "XPath for XML instances" package
][1] - the readme-xml2xpath.htm file documents the use of the stylesheets
]
Crane-xml2xpath.xsl
[[1] - produces a text XPath report of the information items in the XML instance
]
Crane-xml2xpath-html.xsl
[[1] - produces an HTML XPath report of the information items in the XML instance
]
Crane-xml2xpath-instance.xsl
[[1] - produces a text XPath instance report of the information items in the XML instance
]
7.1.11 Exploiting XPath reference numbers
[> 8.][< 7.1.10][^][^^][^^^]
Model reference numbers are more stable than instance reference numbers
[[1] - XPath reference numbers are very stable when obtained from the document model
[[2] - the document model doesn't change very often
][1] - XPath reference numbers are very fragile when obtained from an XML instance
[[2] - the XML instance may have to change if something was forgotten
]]
Stylesheet writing methodology:
[[1] - works with XPath files from either the document model or from a representative instance
[1] - steps 1 and 2 can be performed by a non-technical resource familiar with the form
[1] - steps 3 and 4 would be performed by a stylesheet writer
[1] - note that the nature of the UBL instance having only final values not needing any calculations supports this approach
[[2] - the stylesheet is not responsible for performing calculations on the instance data
[2] - the stylesheet is only laying instance information out on the page and not manipulating values
]]
Step 1 - prototype the layout without using stylesheets
[[1] - draw the layout by hand or use some kind of technology to represent the layout content
[1] - when laying out boxes this involves determining box locations, dimensions and labels
[1] - e.g. see the layout sample on [Figure 7.1]
[[2] - only the layout areas need defining first, not the data content
]]
Step 2 - annotate the layout with a set of XPath reference numbers
[[1] - get the reference numbers from the XPath file of either the document model or a representative XML instance
[1] - e.g. see the reference numbers on [Example 7-1]
[[2] - find the path to the desired item in order to find the bang number
]]
Step 3 - write the stylesheet using the XPath reference numbers as a guideline
[[1] - the reference number in combination with the XPath file provides an unambiguous specification of the XPath address for each
information item in the result
[1] - e.g. see the instance example on [Example 7-2]
[[2] - each element and attribute has a unique bang number
]]
Step 4 - test the stylesheet using the corresponding XPath instance report
[[1] - the stylesheet rendering of the XPath instance report should render the same reference numbers as the annotated layouts produced
in step 2
[1] - e.g. see the layout results on [XPath exhaustive instances - Section 7.1.6 XPath exhaustive instances]
[[2] - may need to parameterize the stylesheet to avoid numeric formatting of non-numeric bang numbers
]]
This is an accessible version of Crane's commercial training material.
The content has been specifically designed to assist screen reader software
in viewing the entire textual content. Figures are replaced with text
narratives.
Navigation hints are in square brackets:
[Tx.x] and [Fx.x] are textual representations of the applicability icons;
[digit] indicates list depth for nested lists;
[link [URL]] indicates the URL of a hyperlink if different than link;
[EXAMPLE] indicates an example listing of code;
[FIGURE] indicates the presence of a figure replaced by its description;
[>] jumps forward;
[<] jumps backward;
[^] jumps to start of the section;
[^^] jumps to the start of the chapter;
[^^^] jumps to the table of contents.
Suggestions for improvement are welcome:
[info@CraneSoftwrights.com]
Book sales: [http://www.CraneSoftwrights.com/links/trn-acc.htm]
Information: [http://www.CraneSoftwrights.com/links/info-acc.htm]
This content is protected by copyright and, as there are no means to protect
this accessible version from plagiarism, please do not make any
commercial edition available to others.
+//ISBN 1-894049::CSL::Presentation::UBL//DOCUMENT Practical Universal Business Language Deployment 2009-02-12 13:50UTC//EN
Practical Universal Business Language Deployment
Third Edition - 2009-02-12
ISBN 978-1-894049-23-8
Copyright © Crane Softwrights Ltd.