怎样才能调用<msxsl:script>的函数?
<xsl:attribute name="href">ReadRss.aspx?RssUrl=<xsl:value-of select="@href"/></xsl:attribute>
如果换成以下就不能正确解析,怎样才能用<msxsl:script>的函数?
<xsl:attribute name="href">ReadRss.aspx?RssUrl=<xsl:value-of select="user:EncodeUrl(@href)"/></xsl:attribute>
.xslt
--------------------------------------------------------------------------------
<?xml version="1.0" encoding="GB2312"?>
<xsl:stylesheet version="1.0" xmlns:xsl="
http://www.w3.org/1999/XSL/Transform" xmlns:msxsl="urn:schemas-microsoft-com:xslt" xmlns:user="
http://chjl.cn/">
<msxsl:script language="javascript" implements-prefix="user">
function EncodeUrl(str) {
return encodeURIComponent(str);
}
</msxsl:script>
<xsl:output method="html" version="1.0" encoding="GB2312" indent="yes"/>
<xsl:template match="/">
<xsl:apply-templates select="sites"/>
</xsl:template>
<xsl:template match="sites">
<table border="1" bordercolor="green">
<xsl:for-each select="site">
<xsl:apply-templates select="."/>
</xsl:for-each>
</table>
</xsl:template>
<xsl:template match="site">
<tbody style="background-color:silver">
<tr>
<td>
<xsl:value-of select="@text"/>
</td>
</tr>
</tbody>
<tbody>
<xsl:for-each select="url">
<xsl:apply-templates select="."/>
</xsl:for-each>
</tbody>
</xsl:template>
<xsl:template match="url">
<tr>
<td onmouseover="this.color='beige'" onmouseout="this.color=''">
<a>
<xsl:attribute name="href">ReadRss.aspx?RssUrl=<xsl:value-of select="@href"/></xsl:attribute>
<xsl:value-of select="@text"/>
</a>
</td>
</tr>
</xsl:template>
</xsl:stylesheet>
--------------------------------------------------------------------------------