xml - Namespace 'http://exslt.og/common' ERROR -
i have 2 servers test server "sever 1" online no firewall. server 2 (production) behind firewall. below code giving following error: namespace 'http://exslt.org/common' not contain functions error show on server 2. if try browsing http://exslt.org/common on either browser page not there.
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/xsl/transform" xmlns:ext="http://exslt.org/common" xmlns:my="my:my" extension-element-prefixes="ext my">
i got above code helpful person on stackoverflow , 95% working on serer2 i'm getting error. rest of code below: please pulling hair out haha.
<?xml version="1.0" encoding="iso-8859-1"?> <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/xsl/transform" xmlns:ext="http://exslt.org/common" xmlns:my="my:my" extension-element-prefixes="ext my"> <my:colors> <c>#fff</c> <c>#ccc</c> </my:colors> <xsl:variable name="vcolors" select="document(\'\')/*/my:colors/*"/> <xsl:template match="newdataset"> <html> <body> <table width="390" style="text-align:left;" cellspacing="0"> <tr> <th style="text-align:left;"><span style="font:20px arial; font-weight:bold;">agent name!</span></th> <th style="text-align:center;"><span style="font:20px arial; font-weight:bold;">state</span></th> <th style="text-align:center;" ><span style="font:20px arial; font-weight:bold;">time</span></th> </tr> <xsl:variable name="vrtfresult"> <xsl:apply-templates> <xsl:sort select="time" data-type="number" order="descending"/> </xsl:apply-templates> </xsl:variable> <xsl:apply-templates select="ext:node-set($vrtfresult)/tr"/> </table> </body> </html> </xsl:template> <xsl:template match="tr"> <xsl:variable name="vpos" select="position()"/> <xsl:copy> <xsl:copy-of select="@*"/> <xsl:attribute name="bgcolor"> <xsl:value-of select="$vcolors[($vpos mod 2)+1]"/> </xsl:attribute> <xsl:copy-of select="node()"/> </xsl:copy> </xsl:template> <xsl:template match="agentsales[state=\'talking out\']"> <tr> <xsl:apply-templates/> </tr> </xsl:template> <xsl:template match="agentsales/agentname"> <td style="text-align:left;"> <span style="font:14px arial; font-weight:bold;text-align:center;"> <xsl:value-of select="."/></span> </td> </xsl:template> <xsl:template match="agentsales/state"> <td style="text-align:center;"> <span style="font:14px arial; font-weight:bold;text-align:center;"> <xsl:value-of select="."/></span> </td> </xsl:template> <xsl:template match="agentsales/time"> <td style="text-align:center;"> <span style="font:14px arial; font-weight:bold;text-align:center;"> <xsl:value-of select="."/></span> </td> </xsl:template> <xsl:template match="agentsales/reason | agentsales"/> </xsl:stylesheet>
your problem is xslt processor runs on 1 ov servers implements node-set()
extension function of exslt, while other xslt processor (running on other server) not implement extension function.
the solution is use same xslt processor on both servers, if possible.
if cannot done, find out namespace (and name) xxx:node-set()
extension function supported on second server, , replace:
xmlns:ext="http://exslt.org/common"
with
xmlns:ext="{the-exact-namespace-to-be-used-for-this-xslt-processor}"
Comments
Post a Comment