如何使用XQuery从布尔转换为整数?

时间:2012-07-10 09:45:52

标签: xquery osb

我试过了:

{ xs:integer($contentAssetProvider/text()) }

{ data($contentAssetProvider) cast as xs:integer? }

但是

Error executing the XQuery transformation: Error parsing XML: {err}XP0021: "false": can not cast to {http://www.w3.org/2001/XMLSchema}integer: error: decimal: Invalid decimal value: unexpected char '102'

我会感激任何意见。感谢

1 个答案:

答案 0 :(得分:1)

解决:     {xs:integer(xs:boolean(data($ homepageAssetProvider)))}