gpt4 book ai didi

xml - 命名空间 'http://exslt.og/common' 错误

转载 作者:数据小太阳 更新时间:2023-10-29 02:42:37 25 4
gpt4 key购买 nike

我有两台服务器,我的测试服务器“服务器 1”在线,没有防火墙。服务器 2(生产)位于防火墙后面。下面是给出以下错误的代码:命名空间“http://exslt.org/common”不包含任何函数此错误仅显示在服务器 2 上。如果我尝试浏览到 http://exslt.org/common在任一浏览器上,该页面都不存在。

<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">

我从 stackoverflow 上一个非常乐于助人的人那里得到了上面的代码,我 95% 认为它在 Serer2 上工作,但现在我只是收到错误。其余代码如下:请帮助我拔头发哈哈。

<?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>

最佳答案

您的问题是,在一个服务器上运行的 XSLT 处理器实现了 EXSLT 的 node-set() 扩展功能,而另一个 XSLT 处理器(运行在另一台服务器上)不实现此扩展功能。

解决方案是尽可能在两台服务器上使用相同的 XSLT 处理器。

如果无法做到这一点,请找出第二个服务器上支持的xxx:node-set() 扩展函数的命名空间(和名称),并替换:

xmlns:ext="http://exslt.org/common"

xmlns:ext="{the-exact-namespace-to-be-used-for-this-XSLT-processor}" 

关于xml - 命名空间 'http://exslt.og/common' 错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/5033502/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com