functx:sequence-type

The sequence type that represents a sequence of nodes or values

Description

The functx:sequence-type function checks the types and/or node kinds of one or more items ($items) and returns a sequence type that matches $items. This is useful for debugging and testing the composition of a sequence.

Parameters

Description

items:item()

the items whose sequence type you want to determine

Examples

XPath

Results

Explanation

functx:sequence-type(2)

xs:integer

functx:sequence-type((‘abc’,’def’))

xs:string+

functx:sequence-type((‘abc’,2))

xs:anyAtomicType+

functx:sequence-type( () )

empty-sequence()

functx:sequence-type($in-xml/*[1])

element()

functx:sequence-type($in-xml/*)

element()+

functx:sequence-type($in-xml//@)

attribute()+

functx:sequence-type($in-xml/*/text())

text()+

functx:sequence-type($in-xml/comment())

comment()

functx:sequence-type($in-xml/node())

node()+

generic because there is a combination of node kinds (element and comment)

functx:sequence-type(($in-xml/*,’2’))

item()+

even more generic because there is a combination of nodes and an atomic value

XPath

Results

functx:sequence-type(2)

xs:integer

functx:sequence-type((‘abc’,’def’))

xs:string+

functx:sequence-type((‘abc’,2))

xs:anyAtomicType+

functx:sequence-type( () )

empty-sequence()

functx:sequence-type($in-xml/*[1])

element()

functx:sequence-type($in-xml/*)

element()+

functx:sequence-type($in-xml//@)

attribute()+

functx:sequence-type($in-xml/*/text())

text()+

functx:sequence-type($in-xml/comment())

comment()

functx:sequence-type($in-xml/node())

node()+

functx:sequence-type(($in-xml/*,’2’))

item()+

Depends On