关于xsl遍历xml中节点的有关问题
关于xsl遍历xml中节点的问题
如题 假设xml中
那么我再xsl中怎么样才能取出body中所有的<a>中对应的值(abc)
用<xsl:for-each>进到body里还是怎么招阿 请高手详细解释
------解决方案--------------------
如题 假设xml中
- XML code
<html> <body> <a name="b">abc</a> <a name="b">abc</a> <a name="b">abc</a> <a name="b">abc</a> <a name="b">abc</a> <a name="b">abc</a> </body> </html>
那么我再xsl中怎么样才能取出body中所有的<a>中对应的值(abc)
用<xsl:for-each>进到body里还是怎么招阿 请高手详细解释
------解决方案--------------------
- XML code
<?xml version="1.0" encoding="UTF-8"?> <xsl:stylesheet version="2.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> <xsl:template match="/html/body"> <xsl:for-each select="a"> <li> <xsl:value-of select="@name"/>- <xsl:value-of select="."/> </li> </xsl:for-each> </xsl:template> </xsl:stylesheet>