commons-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Uwe Barthel (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (JXPATH-176) Pipe not working correctly in xpaths
Date Sat, 21 Nov 2015 08:46:11 GMT

    [ https://issues.apache.org/jira/browse/JXPATH-176?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15020333#comment-15020333
] 

Uwe Barthel commented on JXPATH-176:
------------------------------------

[~xarx]: Could you provide a small test case?

> 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 reliably 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)

Mime
View raw message