Xml XSLT只打印第一个字母
是否可以打印两个xml标记之间的第一个字母。例如,如果您有如下xml代码:Xml XSLT只打印第一个字母,xml,xslt,Xml,Xslt,是否可以打印两个xml标记之间的第一个字母。例如,如果您有如下xml代码: <?xml version="1.0" encoding="UTF-8"?> <!-- Edited by XMLSpy --> <catalog> <cd> <title>Empire Burlesque</title> <artist>Bob Dylan</artist> <country&g
<?xml version="1.0" encoding="UTF-8"?>
<!-- Edited by XMLSpy -->
<catalog>
<cd>
<title>Empire Burlesque</title>
<artist>Bob Dylan</artist>
<country>USA</country>
<company>Columbia</company>
<price>10.90</price>
<year>1985</year>
</cd>
<?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>
而不是:
My CD Collection
Title Artist
Empire Burlesque Bob Dylan
学习XPath字符串函数,如并使用
子字符串(title,1,1)
My CD Collection
Title Artist
Empire Burlesque Bob Dylan