Instance-of expressions

Figure 53. InstanceofExpr

InstanceofExpr

An instance expression can be used to tell whether a JSONiq value matches a given sequence type.

Example 132. Instance of expression

1 instance of integer
      

Result (run with Zorba): true


Example 133. Instance of expression

1 instance of string
      

Result (run with Zorba): false


Example 134. Instance of expression

"foo" instance of string
      

Result (run with Zorba): true


Example 135. Instance of expression

{ "foo" : "bar" } instance of object
      

Result (run with Zorba): true


Example 136. Instance of expression

({ "foo" : "bar" }, { "bar" : "foo" }) instance of json-item+
      

Result (run with Zorba): true


Example 137. Instance of expression

[ 1, 2, 3 ] instance of array?
      

Result (run with Zorba): true


Example 138. Instance of expression

() instance of ()
      

Result (run with Zorba): true