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.

XSLT logic elements

More information Node, Description/ attributes ...

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
More information Node, Description/ attributes ...

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

More information symbol, meaning ...

[1]

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.

More information Function, Description/ Syntax ...
Remove ads

References

Loading related searches...

Wikiwand - on

Seamless Wikipedia browsing. On steroids.

Remove ads