用XML/XSL时候的遇到了几个问题,请大家帮忙看看
xml中有如下内容
<root>
<id>3</id>
<name>软件</name>
<root>
xsl中有如下内容
<a href="list.php?id=***"><xsl:value-of select="root/name"/></a>
怎么把xml里id的值解析到***的位置,点链接后打开list.php?id=3页面?
我想了个解决的办法是写成
function ShowList()
{
id=<xsl:value-of select="root/id"/>;
window.location.href = "list.php?id=" + id;
}
<a href="ShowList()"><xsl:value-of select="root/name"/></a>
但是还是有局限性的,id只能是数字,如果是字符串就出错了。不知道大家是怎么解决的?