Never been to CodeSnippets before?

Snippets is a public source code repository. Easily build up your personal collection of code snippets, categorize them with tags / keywords, and share them with the world (or not, you can keep them private!)

About this user

Niclas Löfgren http://www.niqlas.se

1 total

<xsl:attribute> bygga upp href, img element osv

<img>
<xsl:attribute name="src">
<xsl:value-of select="@url"/>
</xsl:attribute>
</img>

Outputen blir

<img src="xml-urlen">


Bygga upp länk, href med url data från xmlen:

<a>
<xsl:attribute name="href">
<xsl:call-template name="HREF_BUILD"/>
</xsl:attribute>
<xsl:call-template name="Les flere nyheter"/>


Länkens namn

<img src="{$urlroot}filestore/{ATTRIBUTES/ATTRIBUTE[LABEL = 'eventImage']/VALUE/FILE/FILENAME}"/>

Outputen blir

Länkens namn



xsl:attribute

The xsl:attribute allows you to add an attribute to an element. This element is often used when you need to add a source(src) to an image. Remembering that in HTML an img tag is still an element in XML term. So when we are wanting to add any of these attributes to elements, you need to use this technique.
1 total