XSLT <xsl:value-of> 元素
Previous Page Next Page <xsl:value-of> 元素用于提取某个选定节点的值。
<xsl:value-of> 元素
<xsl:value-of> 元素用于提取某个选定节点的值,并把值添加到转换的输出流中:
<?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="/">
<html>
<body>
<h2>My CD Collection</h2>
<table border="1">
<tr bgcolor="#9acd32">
<th>Title</th>
<th>Artist</th>
</tr>
<tr>
<td><xsl:value-of select="catalog/cd/title"/></td>
<td><xsl:value-of select="catalog/cd/artist"/></td>
</tr>
</table>
</body>
</html>
</xsl:template>
</xsl:stylesheet>注释:select 属性的值是一个 XPath 表达式。此表达式的工作方式类似于定位某个文件系统,在其中正斜杠可选择子目录。
上面的转换结果类似这样:
查看此 XML 文件,查看此 XSL 文件,并查看结果。
这个例子的结果有一点缺陷:仅有一行数据从 XML 文档被拷贝到输出结果。
在下面的章节中,你将学习如何使用 <xsl:for-each> 元素来循环遍历 XML 元素,并显示所有的记录。
分享到:
相关推荐
<xsl:output name="xml" method="xml" indent="yes"/> <xsl:output name="html" method="html" indent="yes" omit-xml- declaration="yes"/> <xsl:output name="xhtml" method="xhtml" indent="yes" omit-xml-...
VALUE-OF select="$outputQty" />" hits="<XSL:VALUE-OF select="$hits" />" eliteLevel="<XSL:VALUE-OF select="$eliteLevel" />" linkOpenType="<XSL:VALUE-OF select="$linkOpenType" />" xslt="true" /} 32.{PE....
<property name="lib.dir" value="lib"/> <path id="test.classpath"> <!-- adding the saxon jar to your classpath --> <fileset dir="${lib.dir}" includes="*.jar"/> </path> <target name="transform">...
元素的定义语法为:<!ELEMENT DESCRIPTION (#PCDATA, DEFINITION)*> 说明: "<!ELEMENT" 是元素的声明,说明你要定义的是一个元素; 声明后面的"DESCRIPTION",是元素的名称; "(#PCDATA, DEFINITION)*>"则是...
< xsl value = ' 364 ' format = ' w ' lang = ' cs '> format - date ( xs : date ( '2015-10-11' ) , '[D]. [MNn] [Y]' , 'cs' , 'AD' , '' ) 除了下面提到的一件事外,语法不会改变。 翻译包含有关日期的通常...
xml-stylesheet type='text/xsl' href='_UpgradeReport_Files/UpgradeReport.xslt'?><UpgradeLog> <Properties><Property Name="Solution" Value="CodematicDemo"> </Property><Property Name="解决方案文件" Value=...
SAX (Simple API for XML), DOM (document.nbspObject Model), XSL (Extensible Stylesheet Language), XSLT (XSL Transformations), SOAP (Simple Object Access Protocol), and BML (Bean Markup Language)是XML...
4.5 [xsl:value-of]元素 108 4.6 [xsl:for-each]元素 110 4.7 匹配节点的模式 111 4.8 mode属性 113 4.9 内置的模板规则 114 4.10 对空白的处理 115 4.11 xpath语言 116 4.11.1 xpath上下文 116 4.11.2 位置...
4.5 [xsl:value-of]元素 108 4.6 [xsl:for-each]元素 110 4.7 匹配节点的模式 111 4.8 mode属性 113 4.9 内置的模板规则 114 4.10 对空白的处理 115 4.11 xpath语言 116 4.11.1 xpath上下文 116 4.11.2 位置...
4.5 [xsl:value-of]元素 108 4.6 [xsl:for-each]元素 110 4.7 匹配节点的模式 111 4.8 mode属性 113 4.9 内置的模板规则 114 4.10 对空白的处理 115 4.11 xpath语言 116 4.11.1 xpath上下文 116 4.11.2 位置...
xml-stylesheet type='text/xsl' href='_UpgradeReport_Files/UpgradeReport.xslt'?><UpgradeLog> <Properties><Property Name="Solution" Value="MyGame"> </Property><Property Name="解决方案文件" Value="F:\...
4.5 [xsl:value-of]元素 108 4.6 [xsl:for-each]元素 110 4.7 匹配节点的模式 111 4.8 mode属性 113 4.9 内置的模板规则 114 4.10 对空白的处理 115 4.11 xpath语言 116 4.11.1 xpath上下文 116 4.11.2 位置...
相关文章:什么是XMLXSL(EXtensible Stylesheet Language)它是指可扩展样式表语言...说白了就是将XML中的数据用指定的显示格式输出.XML不像HTML,它不包含任何显示格式的信息.XSL 包含两个部分: XSLT – 用于转换 XML
Using XPath and XSLT in .NET 802 The System.Xml.XPath Namespace 803 The System.Xml.Xsl Namespace 807 Contents XML and ADO.NET 812 Converting ADO.NET Data to XML 812 Converting XML to ADO.NET Data 820 ...
Creating XSL Transformations...................................................................................................... 2-11 Working with Business Services ....................................