one-or-more

Returns a sequence if it contains one or more items, otherwise errors

Description

The fn:one-or-more function returns $arg if it contains one or more items. Otherwise, the error FORG0004 is raised. This function is useful when static typing is in effect, to avoid apparent static type errors.

Parameters

Description

arg:item()

Examples

XPath

Results

one-or-more( () )

Error FORG0004

one-or-more(‘a’)

a

one-or-more( (‘a’, ‘b’) )

(‘a’, ‘b’)

See Also