XSLT: Difference between revisions

From miki
Jump to navigation Jump to search
(Created page with "'''XSLT''' stands for ''Extensible Stylesheet Language Transformations''. == Links == * http://www.w3schools.com/xsl/ == Quick reference == === xsl:attribute === {| width=10...")
 
Line 2: Line 2:


== Links ==
== Links ==
* https://www.w3.org/TR/xslt
* http://www.w3schools.com/xsl/
* http://www.w3schools.com/xsl/



Revision as of 12:07, 5 October 2016

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: