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.
This description is © Copyright 2007, Priscilla Walmsley. It is excerpted from the book XQuery by Priscilla Walmsley, O'Reilly, 2007. For a complete explanation of this function, please refer to Appendix A of the book. Arguments and Return TypeName | Type |
$arg |
item()* |
return value |
item()+ |
ExamplesXPath Example | Results |
---|
one-or-more( () ) |
Error FORG0004 |
one-or-more('a') |
a |
one-or-more( ('a', 'b') ) |
('a', 'b') |
See Alsofn:exactly-one | Returns a sequence if it contains exactly one item, otherwise errors | fn:zero-or-one | Returns a sequence if it contains zero or one items, otherwise errors |
History |
Recommended Reading:
|