Attribute

王朝百科·作者佚名  2012-05-12  
宽屏版  字体: |||超大  

正文定义和用法<xsl:attribute> 元素用于向元素添加属性。[1]

注释:<xsl:attribute> 元素会替换名称相同的已有属性。[1]语法<xsl:attribute name="attributename" namespace="uri">[1]<!-- Content:template --></xsl:attribute>[1]属性属性值描述name

attributename

必需。规定属性的名称。

namespace

URI

可选。为属性定义命名空间的 URI。[1]

实例例子 1向 picture 元素添加 source 属性:[1]

<picture> <xsl:attribute name="source"/></picture>例子 2向 picture 元素添加 source 属性,并使用 "images/name" 中的值为其赋值:

<picture> <xsl:attribute name="source"> <xsl:value-of select="images/name" /> </xsl:attribute></picture>例子 3创建能够应用到任何输出元素的属性集:

<xsl:attribute-set name="font"> <xsl:attribute name="fname">Arial</xsl:attribute> <xsl:attribute name="size">14px</xsl:attribute> <xsl:attribute name="color">red</xsl:attribute></xsl:attribute-set>[1]

 
免责声明:本文为网络用户发布,其观点仅代表作者个人观点,与本站无关,本站仅提供信息存储服务。文中陈述内容未经本站证实,其真实性、完整性、及时性本站不作任何保证或承诺,请读者仅作参考,并请自行核实相关内容。
 
© 2005- 王朝百科 版权所有