XSLT入门教程.doc

  1. 1、本文档共106页,可阅读全部内容。
  2. 2、原创力文档(book118)网站文档一经付费(服务费),不意味着购买了该文档的版权,仅供个人/单位学习、研究之用,不得用于商业用途,未经授权,严禁复制、发行、汇编、翻译或者网络传播等,侵权必究。
  3. 3、本站所有内容均由合作方或网友上传,本站不对文档的完整性、权威性及其观点立场正确性做任何保证或承诺!文档内容仅供研究参考,付费前请自行鉴别。如您付费,意味着您自己接受本站规则且自行承担风险,本站不退款、不进行额外附加服务;查看《如何避免下载的几个坑》。如果您已付费下载过本站文档,您可以点击 这里二次下载
  4. 4、如文档侵犯商业秘密、侵犯著作权、侵犯人身权等,请点击“版权申诉”(推荐),也可以打举报电话:400-050-0827(电话支持时间:9:00-18:30)。
查看更多
XSLT入门教程

Definition and Usage 定义和用法 The xsl:apply-imports element applies a template rule from an imported style sheet. xsl:apply-imports元素遵循的是导入的样式表模版规则。 Template rules in imported style sheets have lower precedence than template rules in main style sheets. The xsl:apply-imports is used when we want to use a template rule from the imported style sheet rather than an equivalent rule in the main style sheet. 导入样式表中的模版规则与主样式表中的模版规则相比,优先级前者比后者低。当你希望使用导入样式表中的模版规则时,你可以书写xsl:apply-imports标签。 Syntax 语法 xsl:apply-imports/ Attributes 属性 None无 Example 案例 Suppose we have a style sheet called standard.xsl that contains a template rule for message elements: 假设我们拥有一个名为“standard.xsl”的样式表,它包含了消息元素的模版规则,具体如下: ?xml version=1.0 encoding=ISO-8859-1? xsl:stylesheet version=1.0 xmlns:xsl=/1999/XSL/Transform xsl:template match=message h2xsl:apply-templates//h2 /xsl:template /xsl:stylesheet Another style sheet could import standard.xsl, and modify the message elements, like this: 另外一张样式表中导入名为“standard.xsl”的样式表文件,用于修饰消息元素,具体如下: ?xml version=1.0 encoding=ISO-8859-1? xsl:stylesheet version=1.0 xmlns:xsl=/1999/XSL/Transform xsl:import href=standard.xsl/ xsl:template match=message div style=border:solid blue xsl:apply-imports/ /div /xsl:template /xsl:stylesheet The result would be to transform a message into an element of the form: 输出的结果是:将一个消息元素转换成一个表单元素: div style=border:solid blueh2.../h2/div Definition and Usage 定义和用法 The xsl:apply-templates element applies a template to the current element or to the current elements child nodes. xsl:apply-templates元素将模版应用于当前元素或应用于当前元素的子节点。 If we add a select attribute to the xsl:apply-templates element it will process only the child element that matches the value of the attribute. We can use the select attribute to specify in which order the child nodes are to be processed. 如果我们想xsl:apply-templates元素中添加一个select[选择]属性,那么它仅处理与属性值相匹配的子元素。我们可以使用select属性指定子节点的处理顺序。 Syntax 语法 xsl:apply-templates select=expression mode=name !-- Content:(xsl:sort|xsl:w

文档评论(0)

peain + 关注
实名认证
内容提供者

该用户很懒,什么也没介绍

1亿VIP精品文档

相关文档