[ https://issues.apache.org/jira/browse/JXPATH-176?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17677693#comment-17677693 ]
Markus Schlegel commented on JXPATH-176: ---------------------------------------- See my suggested patch at JXPATH-189. > 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 > Priority: Major > > 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 (v8.20.10#820010)