|
|
|
|
|
|
| |
XSLT Tutorial
XSLT Elements: xsl:template,
xsl:apply-templates
We have already discussed how XSLT is the transformation tool,
whereby we can take an XML file (or files) and convert it to HTML,
another XML file, SQL select statements - or any text-based
format.
The XSLT elements are the main building blocks for the actual
transformation that occurs in your XSL file.
xsl:template
Note: You need to have at least one template in your XSLT
file.
xsl:apply-template
- The apply-template element is always found inside a
template body.
- It defines a set of nodes to be processed. In this process,
it then may find any 'sub' template rules to process (child elements
of element in context).
- If you want the apply-template instruction to only process
certain child elements, you can define a select attribute, to
only process specific nodes. In the following example, we only
want to process the 'name' and 'address' elements in the root
document element:
<xsl:template match="/">
<xsl:apply-templates select="person/name |
person/address"/>
</xsl:template>
Open Worksheet 3 for a xsl:template & xsl:apply-template example
|
|
|
|
|
|
|
|
|