xsl:attribute

only for RuBoard

xsl:attribute

xsl:attribute creates an attribute of an output element.

Attributes

Attribute Name

Enforced

Description

Values

name

Required

The name of the attribute to add to the output element

QName

namespace

Optional

The namespace to be used for the attribute

URI reference

Example

Given the XML instance document, links.xml :

 <?xml version="1.0" encoding="utf-8" ?>  <links>       <link id="newriders" URL="http://www.newriders.com" name="NewRiders.com"  description="Available books by New Riders" />  </links> 

The following template rule generates an anchor tag:

 <xsl:template match="link">       <a>            <xsl:attribute name="href">                 <xsl:value-of select="@URL"/>            </xsl:attribute>            <xsl:value-of select="@name" />      </a>  </xsl:template> 

This results in the following markup:

 <a href=http://www.newriders.com>Available books by New Riders</a> 

Parent Elements

 xsl:copy, xsl:element, xsl:for-each, xsl:if, xsl:otherwise, xsl:param,  xsl:template, xsl:variable, xsl:when, xsl:with-param 

Child Elements

 xsl:apply-templates, xsl:call-template, xsl:choose, xsl:copy, xsl:copy-of,  xsl:for-each, xsl:if, xsl:text, xsl:variable 
only for RuBoard


XML and ASP. NET
XML and ASP.NET
ISBN: B000H2MXOM
EAN: N/A
Year: 2005
Pages: 184

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net