XSLT

From miki
Revision as of 12:07, 5 October 2016 by Mip (talk | contribs) (→‎Links)
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: