diff --git a/src/main/xar-resources/indexes-test/collection.xconf b/src/main/xar-resources/indexes-test/collection.xconf
index 487a151c..0aa16ec9 100644
--- a/src/main/xar-resources/indexes-test/collection.xconf
+++ b/src/main/xar-resources/indexes-test/collection.xconf
@@ -7,6 +7,18 @@
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/src/main/xar-resources/indexes-test/data/fn-library_2-0.xml b/src/main/xar-resources/indexes-test/data/fn-library_2-0.xml
new file mode 100644
index 00000000..cbe52bf0
--- /dev/null
+++ b/src/main/xar-resources/indexes-test/data/fn-library_2-0.xml
@@ -0,0 +1,873 @@
+
+
+
+
+ XQuery 1.0 and XPath 2.0 Functions and Operators
+ 2 (edition 2)
+ W3C Recommendation 14 December 2010 (revised 13 April 2015)
+
+ Ashok Malhotra
+ Jim Melton
+ Norman Walsh
+ Michael Kay
+
+ https://www.w3.org/TR/xquery-operators
+ http://www.w3.org/TR/2010/REC-xpath-functions-20101214/
+
+ Compiled 2023-12 by Ash Clark.
+ This is free and unencumbered data released into the public domain.
+ Anyone is free to copy, modify, publish, use, compile, sell, or
+ distribute this data for any purpose, commercial or non-commercial,
+ and by any means.
+
+
+
+
+ Accessors
+
+
+ xs:QName
+
+
+
+
+ xs:boolean
+
+
+
+
+
+ xs:string
+
+ XPDY0002
+
+
+
+
+
+ xs:anyAtomicType
+
+ FOTY0012
+
+
+
+ xs:anyURI
+
+ XPDY0002
+ XPDY0004
+
+
+
+
+
+ xs:anyURI
+
+
+
+
+
+
+
+ The Error Function
+
+
+
+
+
+
+ FOER0000
+
+
+
+
+
+ The Trace Function
+
+
+ item()
+
+
+
+
+
+
+ Constructor Functions
+
+
+ A Special Constructor for xs:dateTime
+
+ xs:dateTime
+
+ FORG0008
+
+
+
+
+
+ Functions and Operators on Numerics
+
+
+ Functions on Numeric Values
+
+
+ xs:numeric
+
+
+
+
+ xs:numeric
+
+
+
+
+ xs:numeric
+
+
+
+
+ xs:numeric
+
+
+
+
+ xs:numeric
+
+
+ FOCA0001
+
+
+
+
+
+
+ Functions on Strings
+
+
+ Functions to Assemble and Disassemble Strings
+
+
+ xs:string
+
+ FOCH0001
+
+
+
+ xs:integer
+
+
+
+
+
+ Equality and Comparison of Strings
+
+
+ xs:integer
+
+
+ FOCH0002
+
+
+
+ xs:boolean
+
+
+
+
+
+ Functions on String Values
+
+
+ xs:string
+
+
+
+
+ xs:string
+
+
+
+
+ xs:string
+
+
+
+
+
+ xs:integer
+
+ XPDY0002
+
+
+
+
+
+ xs:string
+
+ XPDY0002
+
+
+
+
+
+ xs:string
+
+
+ FOCH0003
+
+
+
+
+ xs:string
+
+
+
+
+ xs:string
+
+
+
+
+ xs:string
+
+
+
+
+ xs:string
+
+
+
+
+ xs:string
+
+
+
+
+ xs:string
+
+
+
+
+
+ Functions Based on Substring Matching
+
+
+ xs:boolean
+
+
+ FOCH0002
+ FOCH0004
+
+
+
+ xs:boolean
+
+
+ FOCH0002
+ FOCH0004
+
+
+
+ xs:boolean
+
+
+ FOCH0002
+ FOCH0004
+
+
+
+ xs:string
+
+
+ FOCH0002
+ FOCH0004
+
+
+
+ xs:string
+
+
+ FOCH0002
+ FOCH0004
+
+
+
+
+ String Functions that Use Pattern Matching
+
+
+ xs:boolean
+
+
+ FORX0001
+
+ FORX0002
+
+
+
+ xs:string
+
+
+ FORX0001
+
+ FORX0002
+ FORX0003
+ FORX0004
+
+
+
+ xs:string
+
+
+
+ FORX0001
+
+ FORX0002
+ FORX0003
+
+
+
+
+
+
+ Functions on anyURI
+
+
+ xs:anyURI
+
+ FONS0005
+
+
+ FORG0002
+ FORG0009
+
+
+
+
+
+ Functions and Operators on Boolean Values
+
+
+ Additional Boolean Constructor Functions
+
+
+ xs:boolean
+
+
+
+
+ xs:boolean
+
+
+
+
+
+ Functions on Boolean Values
+
+ xs:boolean
+
+ FORG0006
+
+
+
+
+
+
+ Functions and Operators on Durations, Dates and Times
+
+
+ Component Extraction Functions on Durations, Dates and Times
+
+
+ xs:integer
+
+
+
+
+ xs:integer
+
+
+
+
+ xs:integer
+
+
+
+
+ xs:integer
+
+
+
+
+ xs:integer
+
+
+
+
+ xs:decimal
+
+
+
+
+ xs:integer
+
+
+
+
+ xs:integer
+
+
+
+
+ xs:integer
+
+
+
+
+ xs:integer
+
+
+
+
+ xs:integer
+
+
+
+
+ xs:decimal
+
+
+
+
+ xs:dayTimeDuration
+
+
+
+
+ xs:integer
+
+
+
+
+ xs:integer
+
+
+
+
+ xs:integer
+
+
+
+
+ xs:dayTimeDuration
+
+
+
+
+ xs:integer
+
+
+
+
+ xs:integer
+
+
+
+
+ xs:decimal
+
+
+
+
+ xs:dayTimeDuration
+
+
+
+
+
+
+ Timezone Adjustment Functions on Dates and Time Values
+
+
+ xs:dateTime
+
+
+ FODT0003
+
+
+
+
+ xs:date
+
+
+ FODT0003
+
+
+
+
+ xs:time
+
+
+ FODT0003
+
+
+
+
+
+
+
+ Functions Related to QNames
+
+
+ Additional Constructor Functions for QNames
+
+
+ xs:QName
+
+ FOCA0002
+ FONS0004
+
+
+
+ xs:QName
+
+ FOCA0002
+
+
+
+
+ Functions and Operators Related to QNames
+
+
+ xs:NCName
+
+
+
+
+ xs:NCName
+
+
+
+
+ xs:anyURI
+
+
+
+
+ xs:anyURI
+
+
+
+
+ xs:string
+
+
+
+
+
+
+
+ Functions and Operators on Nodes
+
+
+ xs:string
+
+
+ XPDY0002
+ XPTY0004
+
+
+
+ xs:string
+
+
+ XPDY0002
+ XPTY0004
+
+
+
+ xs:anyURI
+
+
+ XPDY0002
+ XPTY0004
+
+
+
+ xs:double
+
+
+ XPDY0002
+
+
+
+ xs:boolean
+
+
+ XPDY0002
+ XPTY0004
+
+
+
+
+ node()
+
+
+ node()
+
+ XPDY0002
+ XPTY0004
+
+
+
+
+
+ Functions and Operators on Sequences
+
+
+ General Functions and Operators on Sequences
+
+
+ xs:boolean
+
+ FORG0006
+
+
+
+ xs:integer
+
+
+ FOCH0002
+
+
+
+
+ xs:boolean
+
+
+
+
+ xs:boolean
+
+
+
+
+ xs:anyAtomicType
+
+
+
+
+
+ item()
+
+
+
+
+ item()
+
+
+
+
+ item()
+
+
+
+
+ item()
+
+
+
+
+
+ item()
+
+
+
+
+
+ Functions That Test the Cardinality of Sequences
+
+
+ item()
+
+ FORG0003
+
+
+
+ item()
+
+ FORG0004
+
+
+
+ item()
+
+ FORG0005
+
+
+
+
+ Equals, Union, Intersection and Except
+
+ xs:boolean
+
+
+ FOCH0002
+
+
+
+
+
+ Aggregate Functions
+
+
+ xs:integer
+
+
+
+
+ xs:anyAtomicType
+
+ FORG0006
+
+
+
+ xs:anyAtomicType
+
+
+ FORG0006
+ FOCH0002
+
+
+
+ xs:anyAtomicType
+
+
+ FORG0006
+ FOCH0002
+
+
+
+
+ xs:anyAtomicType
+
+
+ xs:anyAtomicType
+
+ FORG0006
+
+
+
+
+
+ Functions and Operators that Generate Sequences
+
+
+ element()
+
+
+ FODC0001
+ XPDY0002
+ XPTY0004
+
+
+
+ node()
+
+
+ FODC0001
+ XPDY0002
+ XPTY0004
+
+
+
+ document-node()
+ stable
+
+ FODC0002
+ FODC0003
+ FODC0005
+
+
+
+ xs:boolean
+
+ FODC0005
+
+
+
+ document-node()
+ stable
+
+
+ FODC0004
+
+ FODC0002
+ FODC0003
+
+
+
+ element()
+
+ XPDY0002
+ XPTY0004
+
+
+ FODC0001
+
+
+
+
+
+
+
+ Context Functions
+
+
+ xs:integer
+ contextual
+
+ XPDY0002
+
+
+
+ xs:integer
+ contextual
+
+ XPDY0002
+
+
+
+ xs:dateTimeStamp
+
+
+
+
+ xs:date
+
+
+
+
+ xs:time
+
+
+
+
+ xs:dayTimeDuration
+ contextual
+
+
+
+
+ xs:string
+ contextual
+
+
+
+
+ xs:anyURI
+ contextual
+
+
+
+
+
diff --git a/src/main/xar-resources/indexes-test/data/fn-library_3-0.xml b/src/main/xar-resources/indexes-test/data/fn-library_3-0.xml
new file mode 100644
index 00000000..e16fde19
--- /dev/null
+++ b/src/main/xar-resources/indexes-test/data/fn-library_3-0.xml
@@ -0,0 +1,1634 @@
+
+
+
+
+ XPath and XQuery Functions and Operators 3.0
+ 3
+ W3C Recommendation 08 April 2014
+
+ Michael Kay
+
+ https://www.w3.org/TR/xpath-functions-30
+ http://www.w3.org/TR/2014/REC-xpath-functions-30-20140408/
+
+ Compiled 2023-12 by Ash Clark.
+ This is free and unencumbered data released into the public domain.
+ Anyone is free to copy, modify, publish, use, compile, sell, or
+ distribute this data for any purpose, commercial or non-commercial,
+ and by any means.
+
+
+
+
+ Accessors
+
+
+ xs:QName
+ deterministic
+
+ context-dependent
+ focus-dependent
+ XPDY0002
+ XPDY0004
+
+
+ context-independent
+ focus-independent
+
+
+
+
+ xs:boolean
+ deterministic
+
+ context-dependent
+ focus-dependent
+ XPDY0002
+ XPDY0004
+
+
+ context-independent
+ focus-independent
+
+
+
+
+ xs:string
+ deterministic
+
+ context-dependent
+ focus-dependent
+ XPDY0002
+
+
+ context-independent
+ focus-independent
+ FOTY0014
+
+
+
+
+ xs:anyAtomicType
+ deterministic
+
+ context-dependent
+ focus-dependent
+ XPDY0002
+
+
+ context-independent
+ focus-independent
+ FOTY0012
+ FOTY0013
+
+
+
+
+ xs:anyURI
+ deterministic
+
+ context-dependent
+ focus-dependent
+ XPDY0002
+ XPDY0004
+
+
+ context-independent
+ focus-independent
+
+
+
+
+ xs:anyURI
+ deterministic
+
+ context-dependent
+ focus-dependent
+ XPDY0002
+ XPDY0004
+
+
+ context-independent
+ focus-independent
+
+
+
+
+
+
+ Errors and diagnostics
+
+
+ Raising errors
+
+
+ nondeterministic
+ context-independent
+ focus-independent
+
+
+
+
+ FOER0000
+
+
+
+
+ Diagnostic tracing
+
+ item()
+ deterministic
+ context-independent
+ focus-independent
+
+
+
+
+
+
+
+
+ Functions and operators on numerics
+
+
+ Functions on numeric values
+
+
+ xs:numeric
+ deterministic
+ context-independent
+ focus-independent
+
+
+
+
+ xs:numeric
+ deterministic
+ context-independent
+ focus-independent
+
+
+
+
+ xs:numeric
+ deterministic
+ context-independent
+ focus-independent
+
+
+
+
+ xs:numeric
+ deterministic
+ context-independent
+ focus-independent
+
+
+
+
+
+ xs:numeric
+ deterministic
+ context-independent
+ focus-independent
+
+
+
+
+
+
+ Parsing numbers
+
+
+ xs:double
+ deterministic
+
+ context-dependent
+ focus-dependent
+ XPDY0002
+
+
+ context-independent
+ focus-independent
+
+
+
+
+
+ Formatting integers
+
+
+ xs:string
+ deterministic
+ focus-independent
+
+ context-dependent
+
+
+ context-independent
+
+ FODF1310
+
+
+
+
+ Formatting numbers
+
+
+ xs:string
+ deterministic
+ focus-independent
+
+ context-independent
+
+
+ context-dependent
+
+ FODF1280
+
+
+
+
+ Trigonometric and exponential functions
+
+
+
+
+
+ Functions on strings
+
+
+ Functions to assemble and disassemble strings
+
+
+ xs:string
+ deterministic
+ context-independent
+ focus-independent
+
+ FOCH0001
+
+
+
+ xs:integer
+ deterministic
+ context-independent
+ focus-independent
+
+
+
+
+
+ Comparison of strings
+
+
+ xs:integer
+ deterministic
+ context-dependent
+ focus-independent
+
+
+ FOCH0002
+
+
+
+ xs:boolean
+ deterministic
+ context-independent
+ focus-independent
+
+
+
+
+
+ Functions on string values
+
+
+ xs:string
+ deterministic
+ context-independent
+ focus-independent
+
+
+
+
+ xs:string
+ deterministic
+ context-independent
+ focus-independent
+
+
+
+
+
+ xs:string
+ deterministic
+ context-independent
+ focus-independent
+
+
+
+
+
+ xs:integer
+ deterministic
+
+ context-dependent
+ focus-dependent
+ XPDY0002
+
+
+ context-independent
+ focus-independent
+
+
+
+
+ xs:string
+ deterministic
+
+ context-dependent
+ focus-dependent
+ XPDY0002
+
+
+ context-independent
+ focus-independent
+
+
+
+
+ xs:string
+ deterministic
+ context-independent
+ focus-independent
+
+
+ FOCH0003
+
+
+
+
+ xs:string
+ deterministic
+ context-independent
+ focus-independent
+
+
+
+
+ xs:string
+ deterministic
+ context-independent
+ focus-independent
+
+
+
+
+ xs:string
+ deterministic
+ context-independent
+ focus-independent
+
+
+
+
+
+ Functions based on substring matching
+
+
+ xs:boolean
+ deterministic
+ context-dependent
+ focus-independent
+
+
+ FOCH0002
+ FOCH0004
+
+
+
+ xs:boolean
+ deterministic
+ context-dependent
+ focus-independent
+
+
+ FOCH0002
+ FOCH0004
+
+
+
+ xs:boolean
+ deterministic
+ context-dependent
+ focus-independent
+
+
+ FOCH0002
+ FOCH0004
+
+
+
+ xs:string
+ deterministic
+ context-dependent
+ focus-independent
+
+
+ FOCH0002
+ FOCH0004
+
+
+
+ xs:string
+ deterministic
+ context-dependent
+ focus-independent
+
+
+ FOCH0002
+ FOCH0004
+
+
+
+
+ String functions that use regular expressions
+
+
+ xs:boolean
+ deterministic
+ context-independent
+ focus-independent
+
+
+ FORX0001
+
+ FORX0002
+
+
+
+ xs:string
+ deterministic
+ context-independent
+ focus-independent
+
+
+ FORX0001
+
+ FORX0002
+ FORX0003
+ FORX0004
+
+
+
+ xs:string
+ deterministic
+ context-independent
+ focus-independent
+
+
+ FORX0001
+
+ FORX0002
+ FORX0003
+
+
+
+ element(fn:analyze-string-result)
+ nondeterministic
+ context-independent
+ focus-independent
+
+
+ FORX0001
+
+ FORX0002
+ FORX0003
+
+
+
+
+
+
+
+ Functions that manipulate URIs
+
+
+ xs:anyURI
+ deterministic
+ focus-independent
+
+ context-dependent
+
+
+ context-independent
+
+ FORG0002
+ FONS0005
+ FORG0009
+
+
+
+ xs:string
+ deterministic
+ context-independent
+ focus-independent
+
+
+
+
+ xs:string
+ deterministic
+ context-independent
+ focus-independent
+
+
+
+
+ xs:string
+ deterministic
+ context-independent
+ focus-independent
+
+
+
+
+
+
+ Functions and operators on Boolean values
+
+
+ Boolean constant functions
+
+
+ xs:boolean
+ deterministic
+ context-independent
+ focus-independent
+
+
+
+
+ xs:boolean
+ deterministic
+ context-independent
+ focus-independent
+
+
+
+
+
+ Functions on Boolean values
+
+
+ xs:boolean
+
+
+ FORG0006
+
+
+
+ xs:boolean
+ deterministic
+ context-independent
+ focus-independent
+
+ FORG0006
+
+
+
+
+
+
+ Functions and operators on durations
+
+
+ Component extraction functions on durations
+
+
+ xs:integer
+ deterministic
+ context-independent
+ focus-independent
+
+
+
+
+ xs:integer
+ deterministic
+ context-independent
+ focus-independent
+
+
+
+
+ xs:integer
+ deterministic
+ context-independent
+ focus-independent
+
+
+
+
+ xs:integer
+ deterministic
+ context-independent
+ focus-independent
+
+
+
+
+ xs:integer
+ deterministic
+ context-independent
+ focus-independent
+
+
+
+
+ xs:decimal
+ deterministic
+ context-independent
+ focus-independent
+
+
+
+
+
+
+
+ Functions and operators on dates and times
+
+
+ Constructing a dateTime
+
+
+ xs:dateTime
+ deterministic
+ context-independent
+ focus-independent
+
+ FORG0008
+
+
+
+
+ Component extraction functions on dates and times
+
+
+ xs:integer
+ deterministic
+ context-independent
+ focus-independent
+
+
+
+
+ xs:integer
+ deterministic
+ context-independent
+ focus-independent
+
+
+
+
+ xs:integer
+ deterministic
+ context-independent
+ focus-independent
+
+
+
+
+ xs:integer
+ deterministic
+ context-independent
+ focus-independent
+
+
+
+
+ xs:integer
+ deterministic
+ context-independent
+ focus-independent
+
+
+
+
+ xs:decimal
+ deterministic
+ context-independent
+ focus-independent
+
+
+
+
+ xs:dayTimeDuration
+ deterministic
+ context-independent
+ focus-independent
+
+
+
+
+ xs:integer
+ deterministic
+ context-independent
+ focus-independent
+
+
+
+
+ xs:integer
+ deterministic
+ context-independent
+ focus-independent
+
+
+
+
+ xs:integer
+ deterministic
+ context-independent
+ focus-independent
+
+
+
+
+ xs:dayTimeDuration
+ deterministic
+ context-independent
+ focus-independent
+
+
+
+
+ xs:integer
+ deterministic
+ context-independent
+ focus-independent
+
+
+
+
+ xs:integer
+ deterministic
+ context-independent
+ focus-independent
+
+
+
+
+ xs:decimal
+ deterministic
+ context-independent
+ focus-independent
+
+
+
+
+ xs:dayTimeDuration
+ deterministic
+ context-independent
+ focus-independent
+
+
+
+
+
+ Timezone adjustment functions on dates and time values
+
+
+ xs:dateTime
+ deterministic
+ focus-independent
+
+ context-dependent
+
+
+ context-independent
+ FODT0003
+
+
+
+
+ xs:date
+ deterministic
+ focus-independent
+
+ context-dependent
+
+
+ context-independent
+ FODT0003
+
+
+
+
+ xs:time
+ deterministic
+ focus-independent
+
+ context-dependent
+
+
+ context-independent
+ FODT0003
+
+
+
+
+
+ Formatting dates and times
+
+
+ xs:string
+ deterministic
+ context-dependent
+ focus-independent
+
+
+ FOFD1340
+
+
+
+ xs:string
+ deterministic
+ context-dependent
+ focus-independent
+
+
+ FOFD1340
+ FOFD1350
+
+
+
+ xs:string
+ deterministic
+ context-dependent
+ focus-independent
+
+
+ FOFD1340
+ FOFD1350
+
+
+
+
+
+
+
+ Functions related to QNames
+
+
+ Functions to create a QName
+
+
+ xs:QName
+ deterministic
+ context-independent
+ focus-independent
+
+ FOCA0002
+ FONS0004
+
+
+
+ xs:QName
+ deterministic
+ context-independent
+ focus-independent
+
+ FOCA0002
+
+
+
+
+ Functions and operators related to QNames
+
+
+ xs:NCName
+ deterministic
+ context-independent
+ focus-independent
+
+
+
+
+ xs:NCName
+ deterministic
+ context-independent
+ focus-independent
+
+
+
+
+ xs:anyURI
+ deterministic
+ context-independent
+ focus-independent
+
+
+
+
+ xs:anyURI
+ deterministic
+ context-independent
+ focus-independent
+
+
+
+
+ xs:string
+ nondeterministic-wrt-ordering
+ context-independent
+ focus-independent
+
+
+
+
+
+
+
+ Functions and operators on nodes
+
+
+ xs:string
+ deterministic
+
+ context-dependent
+ focus-dependent
+ XPDY0002
+ XPTY0004
+
+
+ context-independent
+ focus-independent
+
+
+
+
+ xs:string
+ deterministic
+
+ context-dependent
+ focus-dependent
+ XPDY0002
+ XPTY0004
+
+
+ context-independent
+ focus-independent
+
+
+
+
+ xs:anyURI
+ deterministic
+
+ context-dependent
+ focus-dependent
+ XPDY0002
+ XPTY0004
+
+
+ context-independent
+ focus-independent
+
+
+
+
+ xs:boolean
+ deterministic
+
+ context-dependent
+ focus-dependent
+ XPDY0002
+ XPTY0004
+
+
+ context-independent
+ focus-independent
+
+
+
+
+ deterministic
+
+ node()
+ context-dependent
+ focus-dependent
+ XPDY0002
+ XPTY0004
+
+
+ node()
+ context-independent
+ focus-independent
+
+
+
+
+ xs:string
+ deterministic
+
+ context-dependent
+ focus-dependent
+
+
+ context-independent
+ focus-independent
+
+
+
+
+ xs:boolean
+ deterministic
+
+ context-dependent
+ focus-dependent
+ XPDY0002
+ XPTY0004
+
+
+ context-independent
+ focus-independent
+
+
+
+
+ node()
+ deterministic
+ context-independent
+ focus-independent
+
+
+
+
+ node()
+ deterministic
+ context-independent
+ focus-independent
+
+
+
+
+
+ Functions and operators on sequences
+
+
+ General functions and operators on sequences
+
+
+ xs:boolean
+ deterministic
+ context-independent
+ focus-independent
+
+
+
+
+ xs:boolean
+ deterministic
+ context-independent
+ focus-independent
+
+
+
+
+ item()
+ deterministic
+ context-independent
+ focus-independent
+
+
+
+
+ item()
+ deterministic
+ context-independent
+ focus-independent
+
+
+
+
+ item()
+ deterministic
+ context-independent
+ focus-independent
+
+
+
+
+ item()
+ deterministic
+ context-independent
+ focus-independent
+
+
+
+
+ item()
+ deterministic
+ context-independent
+ focus-independent
+
+
+
+
+ item()
+ deterministic
+ context-independent
+ focus-independent
+
+
+
+
+
+ item()
+ deterministic
+ context-independent
+ focus-independent
+
+
+
+
+
+ Functions that compare values in sequences
+
+
+ xs:anyAtomicType
+ deterministic
+ context-dependent
+ focus-independent
+
+
+ FOCH0002
+
+
+
+
+ xs:integer
+ deterministic
+ context-dependent
+ focus-independent
+
+
+ FOCH0002
+
+
+
+
+ xs:boolean
+ deterministic
+ context-dependent
+ focus-independent
+
+
+ FOCH0002
+
+ FOTY0015
+
+
+
+
+ Functions that test the cardinality of sequences
+
+
+ item()
+ deterministic
+ context-independent
+ focus-independent
+
+ FORG0003
+
+
+
+ item()
+ deterministic
+ context-independent
+ focus-independent
+
+ FORG0004
+
+
+
+ item()
+ deterministic
+ context-independent
+ focus-independent
+
+ FORG0005
+
+
+
+
+ Aggregate-functions
+
+
+ xs:integer
+ deterministic
+ context-independent
+ focus-independent
+
+
+
+
+ xs:anyAtomicType
+ deterministic
+ context-independent
+ focus-independent
+
+ FORG0006
+
+
+
+ xs:anyAtomicType
+ deterministic
+ context-dependent
+ focus-independent
+
+
+ FORG0006
+ FOCH0002
+
+
+
+ xs:anyAtomicType
+ deterministic
+ context-dependent
+ focus-independent
+
+
+ FORG0006
+ FOCH0002
+
+
+
+ deterministic
+ context-independent
+ focus-independent
+
+ xs:anyAtomicType
+
+
+ xs:anyAtomicType
+
+ FORG0006
+
+
+
+
+ Functions on node identifiers
+
+
+ element()
+ deterministic
+
+ context-dependent
+ focus-dependent
+ XPDY0002
+ XPTY0004
+
+
+ context-independent
+ focus-independent
+
+ FODC0001
+
+
+
+ element()
+ deterministic
+
+ context-dependent
+ focus-dependent
+ XPDY0002
+ XPTY0004
+
+
+ context-independent
+ focus-independent
+
+ FODC0001
+
+
+
+ node()
+ deterministic
+
+ context-dependent
+ focus-dependent
+ XPDY0002
+ XPTY0004
+
+
+ context-independent
+ focus-independent
+
+ FODC0001
+
+
+
+ xs:string
+ deterministic
+
+ context-dependent
+ focus-dependent
+ XPDY0002
+ XPTY0004
+
+
+ context-independent
+ focus-independent
+
+
+
+
+
+ Functions giving access to external information
+
+
+ document-node()
+ deterministic
+ context-dependent
+ focus-independent
+
+ FODC0002
+ FODC0003
+ FODC0005
+
+
+
+ xs:boolean
+ deterministic
+ context-dependent
+ focus-independent
+
+ FODC0005
+
+
+
+ document-node()
+ deterministic
+ context-dependent
+ focus-independent
+
+
+ FODC0004
+
+ FODC0002
+ FODC0003
+
+
+
+ xs:anyURI
+ deterministic
+ context-dependent
+ focus-independent
+
+
+ FODC0004
+
+ FODC0002
+
+
+
+ xs:string
+ deterministic
+ context-dependent
+ focus-independent
+
+ FOUT1200
+
+
+ FOUT1190
+
+ FOUT1170
+
+
+
+ xs:string
+ deterministic
+ context-dependent
+ focus-independent
+
+ FOUT1200
+
+
+ FOUT1190
+
+ FOUT1170
+
+
+
+ xs:boolean
+ deterministic
+ context-dependent
+ focus-independent
+
+
+
+
+
+ xs:string
+ deterministic
+ context-dependent
+ focus-independent
+
+
+
+
+ xs:string
+ deterministic
+ context-dependent
+ focus-independent
+
+
+
+
+
+ Parsing and serializing
+
+
+ document-node(element(*))
+ nondeterministic
+ context-dependent
+ focus-independent
+
+ FODC0006
+
+
+
+ document-node()
+ nondeterministic
+ context-dependent
+ focus-independent
+
+ FODC0006
+
+
+
+ xs:string
+ deterministic
+ context-independent
+ focus-independent
+
+
+ FODC0010
+
+
+
+
+
+ Context functions
+
+
+ xs:integer
+ deterministic
+ context-dependent
+ focus-dependent
+
+ XPDY0002
+
+
+
+ xs:integer
+ deterministic
+ context-dependent
+ focus-dependent
+
+ XPDY0002
+
+
+
+ xs:dateTimeStamp
+ deterministic
+ context-dependent
+ focus-independent
+
+
+
+
+ xs:date
+ deterministic
+ context-dependent
+ focus-independent
+
+
+
+
+ xs:time
+ deterministic
+ context-dependent
+ focus-independent
+
+
+
+
+ xs:dayTimeDuration
+ deterministic
+ context-dependent
+ focus-independent
+
+
+
+
+ xs:anyURI
+ deterministic
+ context-dependent
+ focus-independent
+
+
+
+
+
+ Higher-order functions
+
+
+ Functions on functions
+
+
+ function(*)
+ deterministic
+ context-dependent
+ focus-dependent
+
+
+
+
+ xs:QName
+ deterministic
+ context-independent
+ focus-independent
+
+
+
+
+ xs:integer
+ deterministic
+ context-independent
+ focus-independent
+
+
+
+
+
+ Basic higher-order functions
+
+
+ item()
+ deterministic
+ context-independent
+ focus-independent
+
+
+
+
+ item()
+ deterministic
+ context-independent
+ focus-independent
+
+
+
+
+
+ item()
+ deterministic
+ context-independent
+ focus-independent
+
+
+
+
+
+ item()
+ deterministic
+ context-independent
+ focus-independent
+ higher-order
+
+
+
+
+
+ item()
+ deterministic
+ context-independent
+ focus-independent
+ higher-order
+
+
+
+
+
+
+
+
+ Constructor functions
+
+
+
diff --git a/src/main/xar-resources/indexes-test/data/fn-library_3-1.xml b/src/main/xar-resources/indexes-test/data/fn-library_3-1.xml
new file mode 100644
index 00000000..5b906d52
--- /dev/null
+++ b/src/main/xar-resources/indexes-test/data/fn-library_3-1.xml
@@ -0,0 +1,1837 @@
+
+
+
+
+ XPath and XQuery Functions and Operators 3.1
+ 4
+ W3C Recommendation 21 March 2017
+
+ Michael Kay
+
+ https://www.w3.org/TR/xpath-functions-31
+ https://www.w3.org/TR/2017/REC-xpath-functions-31-20170321/
+
+ Compiled 2023-12 by Ash Clark.
+ This is free and unencumbered data released into the public domain.
+ Anyone is free to copy, modify, publish, use, compile, sell, or
+ distribute this data for any purpose, commercial or non-commercial,
+ and by any means.
+
+
+
+
+ Accessors
+
+
+ xs:QName
+ deterministic
+
+ context-dependent
+ focus-dependent
+ XPDY0002
+ XPDY0004
+
+
+ context-independent
+ focus-independent
+
+
+
+
+ xs:boolean
+ deterministic
+
+ context-dependent
+ focus-dependent
+ XPDY0002
+ XPDY0004
+
+
+ context-independent
+ focus-independent
+
+
+
+
+ xs:string
+ deterministic
+
+ context-dependent
+ focus-dependent
+ XPDY0002
+
+
+ context-independent
+ focus-independent
+ FOTY0014
+
+
+
+
+ xs:anyAtomicType
+ deterministic
+
+ context-dependent
+ focus-dependent
+ XPDY0002
+
+
+ context-independent
+ focus-independent
+ FOTY0012
+ FOTY0013
+
+
+
+
+ xs:anyURI
+ deterministic
+
+ context-dependent
+ focus-dependent
+ XPDY0002
+ XPDY0004
+
+
+ context-independent
+ focus-independent
+
+
+
+
+ xs:anyURI
+ deterministic
+
+ context-dependent
+ focus-dependent
+ XPDY0002
+ XPDY0004
+
+
+ context-independent
+ focus-independent
+
+
+
+
+
+
+ Errors and diagnostics
+
+
+ Raising errors
+
+
+ nondeterministic
+ context-independent
+ focus-independent
+
+
+
+
+ FOER0000
+
+
+
+
+ Diagnostic tracing
+
+ item()
+ deterministic
+ context-independent
+ focus-independent
+
+
+
+
+
+
+
+
+ Functions and operators on numerics
+
+
+ Functions on numeric values
+
+
+ xs:numeric
+ deterministic
+ context-independent
+ focus-independent
+
+
+
+
+ xs:numeric
+ deterministic
+ context-independent
+ focus-independent
+
+
+
+
+ xs:numeric
+ deterministic
+ context-independent
+ focus-independent
+
+
+
+
+ xs:numeric
+ deterministic
+ context-independent
+ focus-independent
+
+
+
+
+
+ xs:numeric
+ deterministic
+ context-independent
+ focus-independent
+
+
+
+
+
+
+
+ Parsing numbers
+
+
+ xs:double
+ deterministic
+
+ context-dependent
+ focus-dependent
+ XPDY0002
+
+
+ context-independent
+ focus-independent
+
+
+
+
+
+ Formatting integers
+
+
+ xs:string
+ deterministic
+ focus-independent
+
+ context-dependent
+
+
+ context-independent
+
+ FODF1310
+
+
+
+
+ Formatting numbers
+
+
+ xs:string
+ deterministic
+ focus-independent
+
+ context-independent
+
+
+ context-dependent
+
+ FODF1280
+
+
+
+
+ Trigonometric and exponential functions
+
+
+
+ Random Numbers
+
+
+ map(xs:string, item())
+ deterministic
+ context-independent
+ focus-independent
+ higher-order
+
+
+
+
+
+
+
+
+ Functions on strings
+
+
+ Functions to assemble and disassemble strings
+
+
+ xs:string
+ deterministic
+ context-independent
+ focus-independent
+
+ FOCH0001
+
+
+
+ xs:integer
+ deterministic
+ context-independent
+ focus-independent
+
+
+
+
+
+ Comparison of strings
+
+
+ xs:integer
+ deterministic
+ context-dependent
+ focus-independent
+
+
+ FOCH0002
+
+
+
+ xs:boolean
+ deterministic
+ context-independent
+ focus-independent
+
+
+
+
+ xs:base64Binary
+ deterministic
+ context-dependent
+ focus-independent
+
+
+ FOCH0002
+ FOCH0004
+
+
+
+ xs:boolean
+ deterministic
+ context-dependent
+ focus-independent
+
+
+ FOCH0002
+
+
+
+
+ Functions on string values
+
+
+ xs:string
+ deterministic
+ context-independent
+ focus-independent
+
+
+
+
+ xs:string
+ deterministic
+ context-independent
+ focus-independent
+
+
+
+
+
+ xs:string
+ deterministic
+ context-independent
+ focus-independent
+
+
+
+
+
+ xs:integer
+ deterministic
+
+ context-dependent
+ focus-dependent
+ XPDY0002
+
+
+ context-independent
+ focus-independent
+
+
+
+
+ xs:string
+ deterministic
+
+ context-dependent
+ focus-dependent
+ XPDY0002
+
+
+ context-independent
+ focus-independent
+
+
+
+
+ xs:string
+ deterministic
+ context-independent
+ focus-independent
+
+
+ FOCH0003
+
+
+
+
+ xs:string
+ deterministic
+ context-independent
+ focus-independent
+
+
+
+
+ xs:string
+ deterministic
+ context-independent
+ focus-independent
+
+
+
+
+ xs:string
+ deterministic
+ context-independent
+ focus-independent
+
+
+
+
+
+ Functions based on substring matching
+
+
+ xs:boolean
+ deterministic
+ context-dependent
+ focus-independent
+
+
+ FOCH0002
+ FOCH0004
+
+
+
+ xs:boolean
+ deterministic
+ context-dependent
+ focus-independent
+
+
+ FOCH0002
+ FOCH0004
+
+
+
+ xs:boolean
+ deterministic
+ context-dependent
+ focus-independent
+
+
+ FOCH0002
+ FOCH0004
+
+
+
+ xs:string
+ deterministic
+ context-dependent
+ focus-independent
+
+
+ FOCH0002
+ FOCH0004
+
+
+
+ xs:string
+ deterministic
+ context-dependent
+ focus-independent
+
+
+ FOCH0002
+ FOCH0004
+
+
+
+
+ String functions that use regular expressions
+
+
+ xs:boolean
+ deterministic
+ context-independent
+ focus-independent
+
+
+ FORX0001
+
+ FORX0002
+
+
+
+ xs:string
+ deterministic
+ context-independent
+ focus-independent
+
+
+ FORX0001
+
+ FORX0002
+ FORX0003
+ FORX0004
+
+
+
+ xs:string
+ deterministic
+ context-independent
+ focus-independent
+
+
+
+ FORX0001
+
+ FORX0002
+ FORX0003
+
+
+
+ element(fn:analyze-string-result)
+ nondeterministic
+ context-independent
+ focus-independent
+
+
+
+ FORX0001
+
+ FORX0002
+ FORX0003
+
+
+
+
+
+
+
+ Functions that manipulate URIs
+
+
+ xs:anyURI
+ deterministic
+ focus-independent
+
+ context-dependent
+ FONS0005
+
+
+ context-independent
+
+ FORG0002
+ FORG0009
+
+
+
+ xs:string
+ deterministic
+ context-independent
+ focus-independent
+
+
+
+
+ xs:string
+ deterministic
+ context-independent
+ focus-independent
+
+
+
+
+ xs:string
+ deterministic
+ context-independent
+ focus-independent
+
+
+
+
+
+
+ Functions and operators on Boolean values
+
+
+ Boolean constant functions
+
+
+ xs:boolean
+ deterministic
+ context-independent
+ focus-independent
+
+
+
+
+ xs:boolean
+ deterministic
+ context-independent
+ focus-independent
+
+
+
+
+
+ Functions on Boolean values
+
+
+ xs:boolean
+
+
+ FORG0006
+
+
+
+ xs:boolean
+ deterministic
+ context-independent
+ focus-independent
+
+ FORG0006
+
+
+
+
+
+
+ Functions and operators on durations
+
+
+ Component extraction functions on durations
+
+
+ xs:integer
+ deterministic
+ context-independent
+ focus-independent
+
+
+
+
+ xs:integer
+ deterministic
+ context-independent
+ focus-independent
+
+
+
+
+ xs:integer
+ deterministic
+ context-independent
+ focus-independent
+
+
+
+
+ xs:integer
+ deterministic
+ context-independent
+ focus-independent
+
+
+
+
+ xs:integer
+ deterministic
+ context-independent
+ focus-independent
+
+
+
+
+ xs:decimal
+ deterministic
+ context-independent
+ focus-independent
+
+
+
+
+
+
+
+ Functions and operators on dates and times
+
+
+ Constructing a dateTime
+
+
+ xs:dateTime
+ deterministic
+ context-independent
+ focus-independent
+
+ FORG0008
+
+
+
+
+ Component extraction functions on dates and times
+
+
+ xs:integer
+ deterministic
+ context-independent
+ focus-independent
+
+
+
+
+ xs:integer
+ deterministic
+ context-independent
+ focus-independent
+
+
+
+
+ xs:integer
+ deterministic
+ context-independent
+ focus-independent
+
+
+
+
+ xs:integer
+ deterministic
+ context-independent
+ focus-independent
+
+
+
+
+ xs:integer
+ deterministic
+ context-independent
+ focus-independent
+
+
+
+
+ xs:decimal
+ deterministic
+ context-independent
+ focus-independent
+
+
+
+
+ xs:dayTimeDuration
+ deterministic
+ context-independent
+ focus-independent
+
+
+
+
+ xs:integer
+ deterministic
+ context-independent
+ focus-independent
+
+
+
+
+ xs:integer
+ deterministic
+ context-independent
+ focus-independent
+
+
+
+
+ xs:integer
+ deterministic
+ context-independent
+ focus-independent
+
+
+
+
+ xs:dayTimeDuration
+ deterministic
+ context-independent
+ focus-independent
+
+
+
+
+ xs:integer
+ deterministic
+ context-independent
+ focus-independent
+
+
+
+
+ xs:integer
+ deterministic
+ context-independent
+ focus-independent
+
+
+
+
+ xs:decimal
+ deterministic
+ context-independent
+ focus-independent
+
+
+
+
+ xs:dayTimeDuration
+ deterministic
+ context-independent
+ focus-independent
+
+
+
+
+
+ Timezone adjustment functions on dates and time values
+
+
+ xs:dateTime
+ deterministic
+ focus-independent
+
+ context-dependent
+
+
+ context-independent
+ FODT0003
+
+
+
+
+ xs:date
+ deterministic
+ focus-independent
+
+ context-dependent
+
+
+ context-independent
+ FODT0003
+
+
+
+
+ xs:time
+ deterministic
+ focus-independent
+
+ context-dependent
+
+
+ context-independent
+ FODT0003
+
+
+
+
+
+ Formatting dates and times
+
+
+ xs:string
+ deterministic
+ context-dependent
+ focus-independent
+
+
+ FOFD1340
+
+
+
+ xs:string
+ deterministic
+ context-dependent
+ focus-independent
+
+
+ FOFD1340
+ FOFD1350
+
+
+
+ xs:string
+ deterministic
+ context-dependent
+ focus-independent
+
+
+ FOFD1340
+ FOFD1350
+
+
+
+
+ Parsing dates and times
+
+
+ xs:dateTime
+ deterministic
+ context-independent
+ focus-independent
+
+ FORG0010
+
+
+
+
+
+
+ Functions related to QNames
+
+
+ Functions to create a QName
+
+
+ xs:QName
+ deterministic
+ context-independent
+ focus-independent
+
+ FOCA0002
+ FONS0004
+
+
+
+ xs:QName
+ deterministic
+ context-independent
+ focus-independent
+
+ FOCA0002
+
+
+
+
+ Functions and operators related to QNames
+
+
+ xs:NCName
+ deterministic
+ context-independent
+ focus-independent
+
+
+
+
+ xs:NCName
+ deterministic
+ context-independent
+ focus-independent
+
+
+
+
+ xs:anyURI
+ deterministic
+ context-independent
+ focus-independent
+
+
+
+
+ xs:anyURI
+ deterministic
+ context-independent
+ focus-independent
+
+
+
+
+ xs:string
+ nondeterministic-wrt-ordering
+ context-independent
+ focus-independent
+
+
+
+
+
+
+
+ Functions and operators on nodes
+
+
+ xs:string
+ deterministic
+
+ context-dependent
+ focus-dependent
+ XPDY0002
+ XPTY0004
+
+
+ context-independent
+ focus-independent
+
+
+
+
+ xs:string
+ deterministic
+
+ context-dependent
+ focus-dependent
+ XPDY0002
+ XPTY0004
+
+
+ context-independent
+ focus-independent
+
+
+
+
+ xs:anyURI
+ deterministic
+
+ context-dependent
+ focus-dependent
+ XPDY0002
+ XPTY0004
+
+
+ context-independent
+ focus-independent
+
+
+
+
+ xs:boolean
+ deterministic
+
+ context-dependent
+ focus-dependent
+ XPDY0002
+ XPTY0004
+
+
+ context-independent
+ focus-independent
+
+
+
+
+ deterministic
+
+ node()
+ context-dependent
+ focus-dependent
+ XPDY0002
+ XPTY0004
+
+
+ node()
+ context-independent
+ focus-independent
+
+
+
+
+ xs:string
+ deterministic
+
+ context-dependent
+ focus-dependent
+ XPDY0002
+ XPTY0004
+
+
+ context-independent
+ focus-independent
+
+
+
+
+ xs:boolean
+ deterministic
+
+ context-dependent
+ focus-dependent
+ XPDY0002
+ XPTY0004
+
+
+ context-independent
+ focus-independent
+
+
+
+
+ node()
+ deterministic
+ context-independent
+ focus-independent
+
+
+
+
+ node()
+ deterministic
+ context-independent
+ focus-independent
+
+
+
+
+
+ Functions and operators on sequences
+
+
+ General functions and operators on sequences
+
+
+ xs:boolean
+ deterministic
+ context-independent
+ focus-independent
+
+
+
+
+ xs:boolean
+ deterministic
+ context-independent
+ focus-independent
+
+
+
+
+ item()
+ deterministic
+ context-independent
+ focus-independent
+
+
+
+
+ item()
+ deterministic
+ context-independent
+ focus-independent
+
+
+
+
+ item()
+ deterministic
+ context-independent
+ focus-independent
+
+
+
+
+ item()
+ deterministic
+ context-independent
+ focus-independent
+
+
+
+
+ item()
+ deterministic
+ context-independent
+ focus-independent
+
+
+
+
+ item()
+ deterministic
+ context-independent
+ focus-independent
+
+
+
+
+
+ item()
+ nondeterministic-wrt-ordering
+ context-independent
+ focus-independent
+
+
+
+
+
+ Functions that compare values in sequences
+
+
+ xs:anyAtomicType
+ context-dependent
+ focus-independent
+
+ nondeterministic-wrt-ordering
+
+
+ deterministic
+ FOCH0002
+
+
+
+
+ xs:integer
+ deterministic
+ context-dependent
+ focus-independent
+
+
+ FOCH0002
+
+
+
+
+ xs:boolean
+ deterministic
+ context-dependent
+ focus-independent
+
+
+ FOCH0002
+
+ FOTY0015
+
+
+
+
+ Functions that test the cardinality of sequences
+
+
+ item()
+ deterministic
+ context-independent
+ focus-independent
+
+ FORG0003
+
+
+
+ item()
+ deterministic
+ context-independent
+ focus-independent
+
+ FORG0004
+
+
+
+ item()
+ deterministic
+ context-independent
+ focus-independent
+
+ FORG0005
+
+
+
+
+ Aggregate-functions
+
+
+ xs:integer
+ deterministic
+ context-independent
+ focus-independent
+
+
+
+
+ xs:anyAtomicType
+ deterministic
+ context-independent
+ focus-independent
+
+ FORG0006
+
+
+
+ xs:anyAtomicType
+ deterministic
+ context-dependent
+ focus-independent
+
+
+ FORG0006
+ FOCH0002
+
+
+
+ xs:anyAtomicType
+ deterministic
+ context-dependent
+ focus-independent
+
+
+ FORG0006
+ FOCH0002
+
+
+
+ deterministic
+ context-independent
+ focus-independent
+
+ xs:anyAtomicType
+
+
+ xs:anyAtomicType
+
+ FORG0006
+
+
+
+
+ Functions on node identifiers
+
+
+ element()
+ deterministic
+
+ context-dependent
+ focus-dependent
+ XPDY0002
+ XPTY0004
+
+
+ context-independent
+ focus-independent
+
+ FODC0001
+
+
+
+ element()
+ deterministic
+
+ context-dependent
+ focus-dependent
+ XPDY0002
+ XPTY0004
+
+
+ context-independent
+ focus-independent
+
+ FODC0001
+
+
+
+ node()
+ deterministic
+
+ context-dependent
+ focus-dependent
+ XPDY0002
+ XPTY0004
+
+
+ context-independent
+ focus-independent
+
+ FODC0001
+
+
+
+ xs:string
+ deterministic
+
+ context-dependent
+ focus-dependent
+ XPDY0002
+ XPTY0004
+
+
+ context-independent
+ focus-independent
+
+
+
+
+
+ Functions giving access to external information
+
+
+ document-node()
+ deterministic
+ context-dependent
+ focus-independent
+
+ FODC0002
+ FODC0003
+ FODC0005
+
+
+
+ xs:boolean
+ deterministic
+ context-dependent
+ focus-independent
+
+
+
+
+ document-node()
+ deterministic
+ context-dependent
+ focus-independent
+
+
+ FODC0004
+
+ FODC0002
+ FODC0003
+
+
+
+ xs:anyURI
+ deterministic
+ context-dependent
+ focus-independent
+
+
+ FODC0004
+
+ FODC0002
+ FODC0003
+
+
+
+ xs:string
+ deterministic
+ context-dependent
+ focus-independent
+
+ FOUT1200
+
+
+ FOUT1190
+
+ FOUT1170
+
+
+
+ xs:string
+ deterministic
+ context-dependent
+ focus-independent
+
+ FOUT1200
+
+
+ FOUT1190
+
+ FOUT1170
+
+
+
+ xs:boolean
+ deterministic
+ context-dependent
+ focus-independent
+
+
+
+
+
+ xs:string
+ deterministic
+ context-dependent
+ focus-independent
+
+
+
+
+ xs:string
+ deterministic
+ context-dependent
+ focus-independent
+
+
+
+
+
+ Parsing and serializing
+
+
+ document-node(element(*))
+ nondeterministic
+ context-dependent
+ focus-independent
+
+ FODC0006
+
+
+
+ document-node()
+ nondeterministic
+ context-dependent
+ focus-independent
+
+ FODC0006
+
+
+
+ xs:string
+ deterministic
+ context-independent
+ focus-independent
+
+
+ XPTY0004
+ SEPM0016
+
+ FODC0010
+
+
+
+
+
+ Context functions
+
+
+ xs:integer
+ deterministic
+ context-dependent
+ focus-dependent
+
+ XPDY0002
+
+
+
+ xs:integer
+ deterministic
+ context-dependent
+ focus-dependent
+
+ XPDY0002
+
+
+
+ xs:dateTimeStamp
+ deterministic
+ context-dependent
+ focus-independent
+
+
+
+
+ xs:date
+ deterministic
+ context-dependent
+ focus-independent
+
+
+
+
+ xs:time
+ deterministic
+ context-dependent
+ focus-independent
+
+
+
+
+ xs:dayTimeDuration
+ deterministic
+ context-dependent
+ focus-independent
+
+
+
+
+ xs:string
+ deterministic
+ context-dependent
+ focus-independent
+
+
+
+
+ xs:language
+ deterministic
+ context-dependent
+ focus-independent
+
+
+
+
+ xs:anyURI
+ deterministic
+ context-dependent
+ focus-independent
+
+
+
+
+
+ Higher-order functions
+
+
+ Functions on functions
+
+
+ function(*)
+ deterministic
+ context-dependent
+ focus-dependent
+ higher-order
+
+
+
+
+ xs:QName
+ deterministic
+ context-independent
+ focus-independent
+ higher-order
+
+
+
+
+ xs:integer
+ deterministic
+ context-independent
+ focus-independent
+ higher-order
+
+
+
+
+
+ Basic higher-order functions
+
+
+ item()
+ deterministic
+ context-independent
+ focus-independent
+ higher-order
+
+
+
+
+ item()
+ deterministic
+ context-independent
+ focus-independent
+ higher-order
+
+
+
+
+
+ item()
+ deterministic
+ context-independent
+ focus-independent
+ higher-order
+
+
+
+
+
+ item()
+ deterministic
+ context-independent
+ focus-independent
+ higher-order
+
+
+
+
+
+ item()
+ deterministic
+ context-independent
+ focus-independent
+ higher-order
+
+
+
+
+ item()
+ deterministic
+ context-dependent
+ focus-independent
+
+
+
+ higher-order
+
+ XPTY0004
+
+
+
+ item()
+ deterministic
+ context-independent
+ focus-independent
+ higher-order
+
+ FOAP0001
+
+
+
+
+ Dynamic Loading
+
+
+ xs:integer
+ deterministic
+ context-dependent
+ focus-independent
+ higher-order
+
+
+ FOQM0001
+ FOQM0002
+ FOQM0003
+ FOQM0005
+ FOQM0006
+
+
+
+ map(*)
+ nondeterministic
+ context-dependent
+ focus-independent
+
+ FOXT0001
+ FOXT0002
+ FOXT0003
+ FOXT0004
+ FOXT0006
+
+
+
+
+
+ Maps and Arrays
+
+
+ Functions that Operate on Maps
+
+
+
+ Functions that Operate on Arrays
+
+
+
+ Functions on JSON Data
+
+
+ item()
+ deterministic
+ context-independent
+ focus-independent
+
+
+ FOJS0003
+ FOJS0005
+
+ FOJS0001
+
+
+
+ item()
+ deterministic
+ context-dependent
+ focus-independent
+
+
+ FOJS0003
+ FOJS0005
+
+ FOJS0001
+ FOUT1170
+ FOUT1190
+ FOUT1200
+
+
+
+ document-node()
+ nondeterministic
+ context-dependent
+ focus-independent
+
+
+ FOJS0005
+
+ FOJS0001
+ FOJS0004
+
+
+
+ xs:string
+ deterministic
+ context-independent
+ focus-independent
+
+
+ FOJS0005
+
+ FOJS0006
+ FOJS0007
+
+
+
+
+
+ Constructor functions
+
+
+
diff --git a/src/main/xar-resources/modules/indexes.xqm b/src/main/xar-resources/modules/indexes.xqm
index a7f6950f..79d27033 100644
--- a/src/main/xar-resources/modules/indexes.xqm
+++ b/src/main/xar-resources/modules/indexes.xqm
@@ -124,7 +124,7 @@ function indexes:current-collection($node as node(), $model as map(*)) {
declare
%templates:wrap
function indexes:current-index($node as node(), $model as map(*)) {
- indexes:index-name-to-label($indexes:index) || " Index on " || ($indexes:node-name, $indexes:match)[1]
+ indexes:index-name-to-label($indexes:index) || " Index on " || ($indexes:node-name, $indexes:match, $indexes:field)[normalize-space(.) ne ''][1]
};
declare
@@ -218,11 +218,76 @@ function indexes:show-index-keys($node as node(), $model as map(*)) {
return
switch ($indexes:show-keys-by)
case "field" return
+ let $rows :=
+ (: Use the range function in $indexes:range-lookup to determine which arity to
+ use with range:index-keys-for-field(). We can't re-use $indexes:range-lookup
+ as a function here, because the global variable was not initialized explicitly
+ with collection($indexes:collection). This method is probably why we get
+ results on a document-by-document basis, but the alternative is not getting
+ any results at all. :)
if (function-arity($indexes:range-lookup) = 4) then
- collection($indexes:collection)/$indexes:range-lookup($indexes:field, $indexes:start-value, $indexes:callback,
- $indexes:max-number-returned)
+ collection($indexes:collection)/range:index-keys-for-field($indexes:field, $indexes:start-value, $indexes:callback,
+ xs:int($indexes:max-number-returned))
else
- collection($indexes:collection)/$indexes:range-lookup($indexes:field, $indexes:callback, $indexes:max-number-returned)
+ collection($indexes:collection)/range:index-keys-for-field($indexes:field, $indexes:callback,
+ xs:int($indexes:max-number-returned))
+ return
+ (: In some versions of eXist (v5.3.0 – v6.2.0), range:index-keys-for-field()
+ returns erroneous data for the collection:
+ - one row is returned per term *per document*
+ - as such, the "frequency" reported is per document
+ - as such, the "documents" reported is always 1 in every row
+ - as such, the "position" appears to be determined by the number of
+ terms in the document
+ - the maximum number of terms ($indexes:max-number-returned) is either not
+ honored, or (most likely) it would only be honored on a
+ document-by-document basis.
+ If the number of rows matches the number of distinct terms, we can (hopefully)
+ assume that this version of eXist is doing the right thing with the range
+ function.
+ :)
+ if ( count($rows) eq count(distinct-values($rows/td[1])) and
+ count($rows) lt $indexes:max-number-returned ) then
+ $rows
+ (: If the range function appears to be outputting erroneous information for the
+ collection, we clean it up a little for the Monex user:
+ - grouping up terms so only one
is given per unique term,
+ - totalling up frequencies and documents,
+ - setting new positions, and
+ - returning terms within the maximum set by $indexes:max-number-returned.
+ :)
+ else
+ let $distinct-rows :=
+ for $row-grp in $rows
+ let $term := xs:string($row-grp/td[1])
+ group by $term
+ let $total-frequency := sum($row-grp/td[2]/xs:integer(.))
+ let $total-docs := sum($row-grp/td[3]/xs:integer(.))
+ (: Note that because sorting is done after $indexes:max-number-returned is
+ applied, $sorted-keys will only ever be accurate to the first N terms
+ returned. We could get around that for the range index fields by applying
+ the requested sort method here, but instead we're being consistent with
+ the behavior of other index reports. We sort by term here only to ensure
+ that our calculated positions are accurate. :)
+ order by $term[1] ascending
+ return
+ (: Note we're skipping the position here; the document-by-document version
+ is useless. :)
+
+ { $term[1] } |
+ { $total-frequency } |
+ { $total-docs } |
+
+ return
+ (: Now that all the rows have distinct terms, we can determine the correct
+ position for each term across the collection, and honor the requested
+ $indexes:max-number-returned. :)
+ for $row at $pos in subsequence($distinct-rows, 1, $indexes:max-number-returned)
+ return
+
+ { $row/td }
+ { $pos } |
+
case "node" return
util:index-keys($indexes:node-set, $indexes:start-value, $indexes:callback, $indexes:max-number-returned, $index)
default return
@@ -236,28 +301,27 @@ function indexes:show-index-keys($node as node(), $model as map(*)) {
documents := xs:integer($key/td[3])
position := xs:integer($key/td[4])
:)
-
+ let $primary-sort-value :=
+ switch ($indexes:sortby)
+ case 'term' return function($key) { $key/td[1] }
+ case 'frequency' return function($key) { xs:integer($key/td[2]) }
+ case 'documents' return function($key) { xs:integer($key/td[3]) }
+ case 'position' return function($key) { xs:integer($key/td[4]) }
+ default return ''
let $sorted-keys :=
- if ($indexes:sortby eq 'term') then
- if ($indexes:sortorder eq 'ascending') then
- for $key in $keys order by $key/td[1] ascending return $key
- else
- for $key in $keys order by $key/td[1] descending return $key
- else if ($indexes:sortby eq 'frequency') then
- if ($indexes:sortorder eq 'ascending') then
- for $key in $keys order by xs:integer($key/td[2]) ascending, $key/td[1] ascending return $key
- else
- for $key in $keys order by xs:integer($key/td[2]) descending, $key/td[1] ascending return $key
- else if ($indexes:sortby eq 'documents') then
+ (: If the sort method is "term" or "position", we don't need a second sort method. :)
+ if ($indexes:sortby = ('term', 'position')) then
if ($indexes:sortorder eq 'ascending') then
- for $key in $keys order by xs:integer($key/td[3]) ascending, $key/td[1] ascending return $key
+ for $key in $keys order by $primary-sort-value($key) ascending return $key
else
- for $key in $keys order by xs:integer($key/td[3]) descending, $key/td[1] ascending return $key
- else if ($indexes:sortby eq 'position') then
+ for $key in $keys order by $primary-sort-value($key) descending return $key
+ (: If the sort method is "frequency" or "documents", use "term" as a secondary sort method. :)
+ else if ($indexes:sortby = ('frequency', 'documents')) then
if ($indexes:sortorder eq 'ascending') then
- for $key in $keys order by xs:integer($key/td[4]) ascending return $key
+ for $key in $keys order by $primary-sort-value($key) ascending, $key/td[1] ascending return $key
else
- for $key in $keys order by xs:integer($key/td[4]) descending return $key
+ for $key in $keys order by $primary-sort-value($key) descending, $key/td[1] ascending return $key
+ (: No specified sort method, no need to sort. :)
else $keys
let $query-end-time := util:system-time()