Templates
- <xsl:stylesheet />
- Top Level
- <xsl:template match="*">
- Ensures that only the lines you want processed, will be processed
- <xsl:template match="xxx">
- <xsl:template match="xxx" mode="m">
Doesn't work, yet
- <xsl:output
- Modularity
- <xsl:apply-templates match="xxx">
- <xsl:call-template name="xxx">
- Below Top Level
- Looping and sorting
- <xsl:for-each select="xxx">
- saved as dataA.xml by attribute
- order-by
- <xsl:for-each select="xxx" order-by="xxx">
- need a + or a -
- (only works for alphabetical, for numbers it goes: 1 10 11 12
13 ... 2 20 21 22 .... 3 30 31 32 33 ..... and so on, so add your
zeros)
- working copy by element
- order
- <xsl:for-each select="xxx" order="ascending">
- <xsl:for-each select="xxx" order="descending">
- <xsl:sort select="xxx">
- (only works for alphabetical, for numbers it goes: 1 10 11 12
13 ... 2 20 21 22 .... 3 30 31 32 33 ..... and so on, so add your
zeros)
- saved as dataA.xml by attribute
- Conditionals
- <xsl:if test ="xxx">
- <xsl:when match ="xxx">
- <xsl:choose>
- <xsl:otherwise test ="xxx">
- Copy
- Makes a tree-fragment, not a real node of the tree, cannot be searched
directly
- have to use nodeset() to search the result
- <xsl:copy select="xxx">
- Makes a shallow copy -- copies only the node and any namespace -
no descendants or attributes
- working copy by element
- <xsl:copy-of select="xxx">
- Makes a deep copy -- copies the node and any namespace -and descendants
and attributes
- Number
- <xsl:number />
- level="single"
- node's position in relation to siblings in XML page
- level="any"
- impose your own number system on result tree
- level=" multiple"
- numbers sections and sub-sections
- working copy by element
- Text
- <xsl:text />
- puts a text string into the result tree
- preserves whitespace
- disable-output-escaping="yes"
- if omitted, result tree will contain <
- if value = yes, result tree will contain <
- The working example shows nothing
- Element
- <xsl:element name="xxx">
- Convert attributes to elements source tree
- <xsl:attribute-set> defines which attributes to use with the
element
- Allows a namespace attribute, for more control over the namespace
than including the element as literal text in the stylesheet
- The working example shows nothing
- Attribute
- <xsl:attribute name="src">
- Include
- <xsl:include href="myinclude.xsl" />
- use "priority=" to insure visibility and correctness, or your
calling page will override your template
- only use ONE <xsl:template match="/" > .... element
for all the pages, combined
- Imports
- <xsl:import href="myinclude.xsl" /> -- have to be child
elements of <xsl:stylesheet>
- only use ONE <xsl:template match="/" > .... element
for all the pages, combined
XSL Explanation
Templates -- built-in templates, adding modularity,
includes and imports
Templates Examples--
XSL Namespaces-- using namespaces with XSL
XPath -- getting around XSL
XPath Examples
Functions-- using functions
Functions Examples
Variables and Parameters