xsl:attribute-set

only for RuBoard

xsl:attribute-set

Defines a named set of attributes.

Attribute sets are used by specifying a use-attribute-sets attribute on xsl:element , xsl:copy, or xsl:attribute-set elements.

Attributes

Attribute Name

Enforced

Description

Values

name

Required

The name of the attribute set definition

QName

use-attribute-sets

Optional

A list of attribute set names to use for the definition

White space delimited list of attribute set QNames

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" graphics/ccc.gif description="Available books by New Riders" />       <link id="vbdna" URL="http://www.xmlandasp.net" name="Xmlandasp.net" graphics/ccc.gif description="Articles and samples available for VB, DNA, and .NET" />  </links> 

The following template rule generates a table with cells left-aligned and backcolor silver:

 <html>       <body>            <table>  <xsl:template match="link">            <tr>                 <td xsl:use-attribute-sets="leftsilver">                      <xsl:value-of select="@name" />                 </td>            </tr>       </xsl:template>       <xsl:attribute-set name="leftsilver">            <xsl:attribute name="align">left</xsl:attribute>            <xsl:attribute name="bgcolor">silver</xsl:attribute>       </xsl:attribute-set>            </table>       </body>  </html> 

This results in the following markup:

 <html>       <body>            <table>                 <tr>                      <td align="left" bgcolor="silver">                     NewRiders.com                      </td>                 </tr>                 <tr>                     <td align="left" bgcolor="silver">                     Xmlandasp.net                     </td>                 </tr>            </table>       </body>  </html> 

Parent Elements

 xsl:stylesheet, xsl:transform 

Child Elements

 xsl:attribute 
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