XSL(eXtensible Stylesheet Lauguage) is a styling language for XML
is a styling language for XML
XSLT
stands for stands for XSL Transformations.
-
XSL/XSLT are XML based languages.
-
XSL / XSLT allows us to convert one XML structured document into another (data formatting)
-
XSLT is the most common part and it is supported in most web browsers
What is XSL(T)
XSLT is a pattern matching language(rather than a procedural language) that uses templates to generate an output
XSLT Basics
-
XSLT processes nodes of XML document.
-
Uses patten matching to identify the nodes.
-
Performs transformation on those nodes
-
Create a new documents
-
-
Type of XSLT nodes
-
Document
-
Processing Instruction
-
ELement
-
Attribute
-
Text
-
Namespace
-
Comment
-
-
XSLT templates
-
Describe the output based on the matched pattern.
-
Templates can be invoked:
-
Calling templates
-
Can be called by name or by matching nodes against a pattern
-
It's a declaration, so appears as a child node of the stylesheet element.
XSLT Functions
Template construct(What to do)
-
xsl: value - of
Note: if multiple values are returned, value-of only returns the first node value
-
xsl: for - each
<xsl:for-each select=“nodePattern”/>
-
xsl: if
<xsl:if test=“condition”>
-
xsl: choose
<xsl:choose> <xsl:when test=“condition”> <xsl:when> <xsl:otherwise> </xsl:otherwise> </xsl:choose>
-
xsl: apply - templates
XSLT Function
-
ceiling() round decimal up to the nearest integer.
-
floor() round decimal down to the nearest integer.
-
count() determine the quantity in a set.
-
sum() add numbers together