Missing functions in XQuery 1.0 and XPath 2.0 Functions and Operators

I am wondering why the following functions are not included:

1) Equivalents to the Java indexOf() and lastIndexOf() operations on
    strings.

    A typical use case of the latter is to extract the last part of a
    path, e.g. "/this/is/my/path". In this particular case, there is a
    simple workaround, for example:

      fn:tokenize("/this/is/my/path", "/")[last()]

    This is potentially less efficient than a function implementing a
    dumb lastIndexOf() though, and there are arguably cases where you
    just need the index in the string rather than a token.

2) A regexp function that simply returns a sequence of matching
    groups. I know that XSLT 2.0 provides xsl:analyze-string which
    provides advanced matching functionality, but given the presence of
    fn:matches, fn:replace and fn:tokenize in XPath, there is room for
    such a function in XPath itself.

3) There is fn:escape-uri, but no unescape-uri. Java for example
    provides an URLDecoder and an URLEncoder.

I have missed all these when experimenting with early XPath 2.0 / XSLT
2.0 implementations.

-Erik

Received on Monday, 13 October 2003 14:47:34 UTC