Product SiteDocumentation Site

6.4. fn:string (aka string value)

In XQuery, items can have string values, which can be obtained by invoking fn:string. Objects and arrays do not have a string value.
fn:string($arg as item()?) as xs:string
The error conditions of fn:string($arg) are extended as follows. An error is raised (jerr:JNTY0024) if the item is an object or an array.
Example 6.3. Atomization of JSONiq items
          fn:string( {"foo" : 3} )		          jerr:JNTY0024
          fn:string( [1] )			                jerr:JNTY0024
          fn:string( {"foo" : 3, "bar" : 4 } )	jerr:JNTY0024
          fn:string( { } )			                jerr:JNTY0024