Top Qs
Timeline
Chat
Perspective
XSLT elements
Key elements of Extensible Stylesheet Language Transformations (XSLT) From Wikipedia, the free encyclopedia
Remove ads
XSLT (Extensible Stylesheet Language Transformations) defines many elements to describe the transformations that should be applied to a document. This article lists some of these elements. For an introduction to XSLT, see the main article.
This article needs additional citations for verification. (September 2014) |
XSLT logic elements
Example XSLT stylesheet using logic elements
<xsl:stylesheet>
<xsl:template match="//input">
<xsl:variable name="type" select="@type"/>
<xsl:variable name="name" select="@name"/>
<xsl:if test="$type='text' or $type='password' or $type='radio' or $type='checkbox'">
<xsl:choose>
<xsl:when test="$type='radio'">
<xsl:if test="not(preceding-sibling::input[@type='radio'])">
<select name="{@name}">
<xsl:for-each select="../input[@name=$name]">
<option value="{@value}">
<xsl:apply-templates/>
</option>
</xsl:for-each>
</select>
</xsl:if>
</xsl:when>
<xsl:when test="$type='text'">
<input name="{@name}" type="{@type}">
<xsl:apply-templates/>
</input>
</xsl:when>
<xsl:when test="$type='password'">
<input name="{@name}" type="{@type}">
<xsl:apply-templates/>
</input>
</xsl:when>
</xsl:choose>
</xsl:if>
</xsl:template>
</xsl:stylesheet>
Remove ads
XSLT file I/O elements
Summarize
Perspective
Client-side XSLT can be implemented in a browser by adding a line like the following to the source XML file, right after the root XML tag.
<?xml-stylesheet type="text/xsl" href="family.xsl"?>
This is described on the page http://www.xml.com/pub/a/2000/10/25/msie/index.html
Remove ads
Other XSLT semantics
Functions defined by XSLT
Summarize
Perspective
The following functions can occur in many XSLT attributes, such as xsl:value-of.select and xsl:for-each.select.
Remove ads
External links
- W3C XSLT 1.0 recommendation - Describes the whole syntax and semantics of XSLT 1.0
- W3C XSLT 2.0 recommendation
- XSLT Elements Reference - by W3Schools
References
Wikiwand - on
Seamless Wikipedia browsing. On steroids.
Remove ads