Skip to content

fn:root() vs. absolute path expressions #2360

@ChristianGruen

Description

@ChristianGruen

Is there a particular reason why the absolute slash / is defined as complicated as…

self::gnode()/(fn:root(.) treat as (document-node()|jnode())/PP

…and wouldn’t it be helpful to simplify it get rid of the treat as expression?

self::gnode()/fn:root(.)/PP

In many cases, the document node does not exist or is not really needed, and it would allow users to use the slash for nodes that would otherwise needs to wrapped into document nodes, for example:

let $as := analyze-string('abc', 'b')
return $as/fn:match[/fn:non-match]

Metadata

Metadata

Assignees

No one assigned

    Labels

    EnhancementA change or improvement to an existing featureXPathAn issue related to XPath

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions