[ 
https://issues.apache.org/jira/browse/JXPATH-176?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Martin Xarx updated JXPATH-176:
-------------------------------
    Description: 
It seems to me that "pipes" do not work in JXPath, or at least not for java 
containers:

    xpath: size(x/name|name), result: 0
    xpath: x/name|name, result: ROOT name
    xpath: (x/name|name), result: ROOT name

while there is:

    xpath: size(name), result: 1
    xpath: name, result: ROOT name
    xpath: (name), result: ROOT name

    xpath: size(x/name), result: 1
    xpath: x/name, result: X name
    xpath: (x/name), result: X name

The data model is like this:

    {
        "name" : "ROOT name",
        "x" : {
                "name" : "X name"
        }
    }

and the context is set to the root node. I'm using the following code:

    JXPathContext xpathContext = JXPathContext.newContext(root);
    Pointer p = contextContext.getPointer(xpath);
    return p.getNode();



  was:
It seems to me that "pipes" do not work in JXPath, or at least not for java 
containers:

{{    xpath: size(x/name|name), result: 0
    xpath: x/name|name, result: ROOT name
    xpath: (x/name|name), result: ROOT name
}}
while there is:

{{    xpath: size(name), result: 1
    xpath: name, result: ROOT name
    xpath: (name), result: ROOT name

    xpath: size(x/name), result: 1
    xpath: x/name, result: X name
    xpath: (x/name), result: X name
}}

The data model is like this:

{{    {
        "name" : "ROOT name",
        "x" : {
                "name" : "X name"
        }
    }
}}
and the context is set to the root node. I'm using the following code:

{{    JXPathContext xpathContext = JXPathContext.newContext(root);
    Pointer p = contextContext.getPointer(xpath);
    return p.getNode();
}}



> Pipe not working correctly in xpaths
> ------------------------------------
>
>                 Key: JXPATH-176
>                 URL: https://issues.apache.org/jira/browse/JXPATH-176
>             Project: Commons JXPath
>          Issue Type: Bug
>    Affects Versions: 1.3
>         Environment: Windows 7 Enterprise, JDK 1.8.0
>            Reporter: Martin Xarx
>
> It seems to me that "pipes" do not work in JXPath, or at least not for java 
> containers:
>     xpath: size(x/name|name), result: 0
>     xpath: x/name|name, result: ROOT name
>     xpath: (x/name|name), result: ROOT name
> while there is:
>     xpath: size(name), result: 1
>     xpath: name, result: ROOT name
>     xpath: (name), result: ROOT name
>     xpath: size(x/name), result: 1
>     xpath: x/name, result: X name
>     xpath: (x/name), result: X name
> The data model is like this:
>     {
>       "name" : "ROOT name",
>       "x" : {
>               "name" : "X name"
>       }
>     }
> and the context is set to the root node. I'm using the following code:
>     JXPathContext xpathContext = JXPathContext.newContext(root);
>     Pointer p = contextContext.getPointer(xpath);
>     return p.getNode();



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to