×
XML Schema 教程XML Schemas 简介为什么使用 Schema?如何使用 XML SchemaSchema 元素XSD 简易元素Schema 属性Schema 限定 / FacetsSchema 复合元素Schema 复合空元素Schema 复合类型 - 仅含元素Schema 复合元素 - 仅含文本Schema 复合类型 - 混合内容Schema 指示器Schema any 元素anyAttribute 元素Schema 元素替换XML Schema 实例Schema 字符串数据类型Schema 日期/时间类型Schema 数值数据类型Schema 杂项数据类型XML 编辑器XML Schema 总结XML Schema 参考手册

XSLT <xsl:attribute> 元素


XML Schema 参考手册XML Schema 参考手册


定义和用法

<xsl:attribute>元素用于向元素添加属性。

注释:<xsl:attribute> 元素会替换名称相同的已有属性。


语法

<xsl:attribute name="attributename" namespace="uri">

<!-- Content:template -->

</xsl:attribute>

属性

属性 描述
name attributename 必需。规定属性的名称。
namespace URI 可选。为属性定义命名空间的 URI。

实例 1

向 picture 元素添加 source 属性:

<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>

XML Schema 参考手册XML Schema 参考手册


分类导航

关注微信下载离线手册

bootwiki移动版 bootwiki
(群号:472910771)