XSLT

From miki
Revision as of 08:56, 5 October 2016 by Mip (talk | contribs) (Created page with "'''XSLT''' stands for ''Extensible Stylesheet Language Transformations''. == Links == * http://www.w3schools.com/xsl/ == Quick reference == === xsl:attribute === {| width=10...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

XSLT stands for Extensible Stylesheet Language Transformations.

Links

Quick reference

xsl:attribute

Input Output
<link site="www.stackoverflow.com"/>
<a href="http://www.stackoverflow.com">Click here</a>

Use

<xsl:template match="link">
    <a>
        <xsl:attribute name="href">
            <xsl:text>http://</xsl:text><xsl:value-of select="@site"/>
        </xsl:attribute>
        <xsl:text>Link</xsl:text>
    </a>
</xsl:template>

Or shorter using curly braces {...} [1]:

<xsl:template match="link">
    <a href="http://{@site}">Click here</a>
</xsl:template>

Also for: