XPath错误消息(数据类型) [英] XPath error message (data types)
问题描述
你好,
我不明白为什么我会从XPath中收到以下错误:
Hello,
I do not understand why I get the following error from XPath:
1.
<xsl:choose>
<xsl:when test="$rownr = 0">
<xsl:attribute name="FontSize" select=" '24 px' "/>
<xsl:attribute name="Foreground" select=" 'MidnightBlue' "/>
</xsl:when>
</xsl:choose>
<!-- Warning: Required item type of first operand of '=' is numeric; supplied value has item type xs:string -->
我从中了解到的是,应该为变量$ rownr赋予一个数值作为正确的操作数.我不明白,因为$ rownr是未定义的类型(我认为)并且正确的操作数已经是数字,即0而不是``0''(我认为).
如何解决此问题以及代码中的实际情况?
我正在使用EditX Xml Editor免费版本.
谢谢
//我通过编写此代码修复了该问题:
< xsl:param name ="rownr"> 0</xsl:param>
我不知道为什么用这种方法解决了错误.
有人可以告诉我吗?
谢谢
All I understand from it, is that the variable $rownr is supposed to be given a numeric value as right operand. I do not understand that, because $rownr is of an undefined type (I think) and the right operand is already numeric, i.e. 0 and not ''0'' (I think).
How do I fix this and what is really going on in my code?
I am using EditX Xml Editor free version.
Thank you
// I have fixed it by writing this:
<xsl:param name="rownr">0</xsl:param>
I do not know why the error was fixed this way.
Can someone please tell me?
Thank you
推荐答案
rownr = 0" < xsl:attribute 名称 =" 选择 ' 24 px'" > < xsl:attribute 名称 =" 选择 ' MidnightBlue'" > < /xsl:何时 > < /xsl:choose > <!- 警告:"="的第一个操作数的必需项类型'是数字;提供的值的项目类型为xs:string ->
rownr = 0"> <xsl:attribute name="FontSize" select=" '24 px' "/> <xsl:attribute name="Foreground" select=" 'MidnightBlue' "/> </xsl:when> </xsl:choose> <!-- Warning: Required item type of first operand of '=' is numeric; supplied value has item type xs:string -->
我从中了解到的是,应该给变量
All I understand from it, is that the variable
rownr一个数值作为正确的操作数.我不明白,因为
rownr is supposed to be given a numeric value as right operand. I do not understand that, because
rownr是未定义的类型(我认为),并且正确的操作数已经是数字,即0而不是"0"(我认为).
如何解决此问题以及代码中的实际情况?
我正在使用EditX Xml Editor免费版本.
谢谢
//我通过编写此代码修复了该问题:
< xsl:param name ="rownr"> 0</xsl:param>
我不知道为什么用这种方法解决了错误.
有人可以告诉我吗?
谢谢
rownr is of an undefined type (I think) and the right operand is already numeric, i.e. 0 and not ''0'' (I think).
How do I fix this and what is really going on in my code?
I am using EditX Xml Editor free version.
Thank you
// I have fixed it by writing this:
<xsl:param name="rownr">0</xsl:param>
I do not know why the error was fixed this way.
Can someone please tell me?
Thank you
这篇关于XPath错误消息(数据类型)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!