[Accessibility conventions are described at the bottom of the page]
*** This is a free preview excerpt of a commercial publication. ***

4. Processing model
[> 5.][< 3.0.4][^^^]
4.0 A predictable behavior for processors
[> 5.][< 4.][^^][^^^]
The basic processing model for XSLT is designed to ensure predictability
[[1] - predictable processing behavior every time
[[2] - all aspects of the processing are well-defined
][1] - processor builds the operation tree of nodes from the transformation expression
[[2] - some nodes of which are evaluations and calculations
 [2] - some nodes of which may be engaging extensions implemented by the processor
 [2] - the remainder of which are literal result elements that are to be used in the construction of the result
][1] - processor builds the source tree of nodes from the primary source resource
[[2] - a primary source tree is not required
 [2] - the markup of the XML source document is not material
 [2] - the vocabulary used in the source is not material to the processor
[[3] - with the exception of xml:*= attributes available for use with all XML vocabularies
]][1] - result tree construction starts with operation tree
[[2] - start with the template of the template rule for the root node
 [2] - [T2.0]alternatively start at a specified named template or mode
][1] - the transform constructs the content of the result node tree in result parse order in one pass
[[2] - the transform writer must plan the flow of the transform process according to the document order of the result
 [2] - other source trees are created from other source files on request by the transform
 [2] - components from the source trees are obtained where required when executing instructions found in the transform
 [2] - once a portion of the result tree is completely generated there is no method of returning to modify the result tree in any way
][1] - the result tree of nodes may be serialized into markup
[[2] - XML markup
 [2] - HTML markup (using SGML lexical conventions)
 [2] - XHTML markup (using XML lexical conventions)
 [2] - simple text
 [2] - syntax and lexical conventions recognized by the particular implementation of the processor (binary or text)
 [2] - interpreted XSL formatting objects (e.g.: display, print, aural, etc.)
 [2] - remember the processor is not required to support any particular serialization method and may choose to serialize the tree as XML only if at all
]]
A simple illustration of the basic process
[[1] - the illustrated operation node tree has literal result nodes and a single operation node
 [1] - the operation node obtains information from a particular point in the source tree
 [1] - not shown in this illustration are built in behaviors copying nodes to the result tree
]
[Figure 4.1: Process model illustration
A large diagram showing information "inside" a processor. From a triangle above the top edge labeled "Transform", the operation tree is shown in the processor as a tree of double-concentric-edged circles, one with an "X" through the center. From the left edge, a source tree is shown in the processor as tree of single-edged circles. Various sources of information are possible origins of the information in the tree, including XML files, data base files, flat text and feeds. To the right of an embedded box labeled "Operation Execution", the result tree is shown as a combination of double-concentric-edged circles (without "X" in any of them) and single-edged circles, representing literal result nodes and source tree nodes respectively. The double-concentric-edged circles with the "X" are action nodes that would be interpreted by execution to result in some combination of the source tree nodes.
To the right are various output reifications of the result tree: XSL formatting objects as screen, print or aural presentation, or serializations in either XML, SGML using HTML, or non-XML files.
]
The diagram's action nodes are created from XSLT instructions.
The XSLT instructions covered in this chapter are as follows.
Instructions related to process control:
[[1] - [<xsl:if>]
[[2] - single-state conditional inclusion of a template
][1] - [<xsl:choose>]
[[2] - multiple-state conditional inclusion of one of a number of templates
][1] - [<xsl:when>]
[[2] - single-state conditional inclusion of a template within a multiple-state condition
][1] - [<xsl:otherwise>]
[[2] - default-state conditional inclusion of a template within a multiple-state condition
]]
Instructions to pull information from the source tree or to calculate values:
[[1] - [<xsl:copy-of>]
[[2] - add to the result tree a copy of nodes from the source tree
][1] - [<xsl:value-of>]
[[2] - add to the result tree the evaluation of an expression or the value of a source tree node
][1] - [<xsl:for-each>]
[[2] - reposition to a selection of source tree nodes or values using a supplied template
]]
Instructions to push information from the source tree through the stylesheet:
[[1] - [<xsl:apply-templates>]
[[2] - supply a selection of source tree nodes to push through template rules
][1] - [<xsl:template>]
[[2] - define a template rule
]]

*** This is a free preview excerpt of a commercial publication. ***

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 978-1-894049::CSL::Courses::PTUX//DOCUMENT Practical Transformation Using XSLT and XPath 2011-02-11 21:00UTC//EN
Practical Transformation Using XSLT and XPath
Fourteenth Edition - 2011-02-11
ISBN 978-1-894049-24-5
Copyright © Crane Softwrights Ltd.