Denis
Denis

Reputation: 837

How to cast from boolean to integer using XQuery?

I tried:

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

and

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

but getting

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'

I'll appreciate any input. Thanks

Upvotes: 1

Views: 4299

Answers (1)

Denis
Denis

Reputation: 837

Solved with: { xs:integer(xs:boolean(data($homepageAssetProvider))) }

Upvotes: 2

Related Questions