0 0

xslt中获得xml 节点后 能不能反过来再获取该节点的xpath路径5

<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">

<xsl:template  match="/">
	<table border="1">
		<tr bgcolor="#9acd32">
			<th align="left">Title</th>
			<th align="left">Artist</th>
			<th align="left">Price</th>
		</tr>
	  <xsl:for-each select="catalog/cd">
	    <tr xpath="????">
	    	<xsl:attribute name="xpath">
	    		//我想给tr添加一个xpath 属性,而属性值就是当前节点的(cd)xpath路径该怎么做?
	    	</xsl:attribute>
			<td><xsl:value-of select="title"/></td>
			<td><xsl:value-of select="aritst"/></td>
			<td><xsl:value-of select="price"/></td>
		</tr>
	  </xsl:for-each>
  </table>
</xsl:template>

</xsl:stylesheet>
2011年6月22日 11:02
目前还没有答案

相关推荐

Global site tag (gtag.js) - Google Analytics