| 1 |
|
| 2 |
|
| 3 |
|
| 4 |
|
| 5 |
|
| 6 |
|
| 7 |
|
| 8 |
<html> |
| 9 |
|
| 10 |
<head> |
| 11 |
<title>Package overview: net.sf.saxon.style</title> |
| 12 |
|
| 13 |
</head> |
| 14 |
|
| 15 |
|
| 16 |
<body> |
| 17 |
|
| 18 |
<p>This package provides classes used during the compilation of an XSLT stylesheet. |
| 19 |
The instances of these classes are discarded once compilation is complete, and they play no role |
| 20 |
in executing the transformation at run-time, except when tracing and debugging are invoked.</p> |
| 21 |
|
| 22 |
<p>The class <b>StyleElement</b> represents an element node on the stylesheet tree. Subclasses |
| 23 |
of StyleElement represent individual stylesheet elements, and are generally named according to |
| 24 |
the XSLT element name, for example XSLApplyTemplates, XSLChoose. The class <b>XSLStylesheet</b> |
| 25 |
is used for the <code>xsl:stylesheet</code> element in each stylesheet module, and in particular for the |
| 26 |
<code>xsl:stylesheet</code> element in the principal stylesheet module.</p> |
| 27 |
|
| 28 |
<p>During construction of the stylesheet tree, the class <b>StyleNodeFactory</b> is nominated to |
| 29 |
the <b>Builder</b> as the factory class responsible for creating element nodes on the tree. It is |
| 30 |
this class that decides which subclass of StyleElement to use for each element appearing in the |
| 31 |
stylesheet. For extension elements, the decision is delegated to a user-created |
| 32 |
<b>ExtensionElementFactory</b>.</p> |
| 33 |
|
| 34 |
<p>Each class provides a number of methods supporting the various phases of processing. The sequence |
| 35 |
of events sometimes varies slightly, but in general the first phase is done by <code>prepareAttributes</code>, |
| 36 |
which performs local validation of the attributes of each instruction. The second phase is represented |
| 37 |
by the <code>validate</code> method, which does global validation, fixup of references, and type checking. |
| 38 |
The third phase is done by the <code>compile</code> method, which generates <code>Instruction</code> and |
| 39 |
<code>Expression</code> objects. Further processing (local and global optimization) is then done on these |
| 40 |
Instruction objects, and is no longer the responsibility of this package.</p> |
| 41 |
|
| 42 |
|
| 43 |
</body> |
| 44 |
</html> |