惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

Google DeepMind News
Google DeepMind News
Jina AI
Jina AI
IT之家
IT之家
J
Java Code Geeks
博客园_首页
Stack Overflow Blog
Stack Overflow Blog
量子位
I
InfoQ
博客园 - 【当耐特】
阮一峰的网络日志
阮一峰的网络日志
WordPress大学
WordPress大学
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
博客园 - 司徒正美
V
V2EX
博客园 - Franky
U
Unit 42
S
SegmentFault 最新的问题
美团技术团队
The Register - Security
The Register - Security
Last Week in AI
Last Week in AI
G
Google Developers Blog
aimingoo的专栏
aimingoo的专栏
博客园 - 叶小钗
M
MIT News - Artificial intelligence
博客园 - 聂微东
腾讯CDC
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
T
Troy Hunt's Blog
B
Blog
P
Palo Alto Networks Blog
Threat Intelligence Blog | Flashpoint
Threat Intelligence Blog | Flashpoint
P
Privacy International News Feed
K
Kaspersky official blog
The GitHub Blog
The GitHub Blog
C
Cisco Blogs
Microsoft Azure Blog
Microsoft Azure Blog
F
Fortinet All Blogs
S
Schneier on Security
C
CERT Recently Published Vulnerability Notes
cs.CV updates on arXiv.org
cs.CV updates on arXiv.org
Engineering at Meta
Engineering at Meta
TaoSecurity Blog
TaoSecurity Blog
小众软件
小众软件
T
Threatpost
Exploit-DB.com RSS Feed
Exploit-DB.com RSS Feed
Martin Fowler
Martin Fowler
AWS News Blog
AWS News Blog
V
Visual Studio Blog
Simon Willison's Weblog
Simon Willison's Weblog
H
Heimdal Security Blog

博客园 - roboth

转:“由于代码已经过优化或者本机框架位于调用堆栈之上,无法计算表达式的值”的解决方法 .net tostring format格式说明 - roboth 一、DIP简介(DIP--Dependency Inversion Principle): 请确认 <Import> 声明中的路径正确,且磁盘上存在该文件。 异步委托 Visual Studio 最常用的13个快捷键 H1N1:速饮配方 通过注册表获取文件的ContentType [转]解决ASP.NET Web Applicatio超时时间已到.在操作完成之前超时时间已过或服务器未响应 - roboth 在线创建pdf msdn之sp_xml_preparedocument Route命令使用详解 电子书下载 买药记 抓取图片 盲人摸象 sql产生日历表 dom操作时机 js小技巧之访问元素属性
xslt之<xsl:apply-templates - roboth - 博客园
roboth · 2009-05-20 · via 博客园 - roboth

apply-templates>元素中增加一个select属性,它将只对与属性匹配的子元素有效。我们可以用select属性来指定要处理的子节点。
--------------------------------------------------------------------------------
语法
<xsl:apply-templates select="expression" mode="name">
<!-- Content:(xsl:sort|xsl:with-param)* -->
</xsl:apply-templates>
属性
属性

说明
select
expression
select表达式是可选的用于指定要处理的节点。一个星号*选择了全部的节点集。如果属性省略了,那么所有的子节点都将被选择。
mode
name
mode也是可选的,如果对一个相同的元素有很多定义,那么用mode可以区分他们。
例子 1
对于文档中的每一个tiltle元素用h1元素包装。
<?xml version="1.0" encoding="ISO-8859-1"?>
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:template match="title">
<h1><xsl:apply-templates/></h1>
</xsl:template>
</xsl:stylesheet>
例子 2
对于文档中的所有message 元素的子元素tiltle用h1元素包装。
<?xml version="1.0" encoding="ISO-8859-1"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:template match="message">
<h1><xsl:apply-templates select="title"/></h1>
</xsl:template>
</xsl:stylesheet>
例子 3
对于文档中的所有message 元素的所有子元素用h1元素包装,mode属性被置为”big”。
<?xml version="1.0" encoding="ISO-8859-1"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:template match="message">
<h1><xsl:apply-templates select="*" mode="big"/></h1>
</xsl:template>
</xsl:stylesheet>

posted @ 2009-05-20 10:15  roboth  阅读(267)  评论()    收藏  举报