commons-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Martin Xarx (JIRA)" <j...@apache.org>
Subject [jira] [Created] (JXPATH-176) Pipe not working correctly in xpaths
Date Tue, 28 Apr 2015 14:47:05 GMT
Martin Xarx created JXPATH-176:
----------------------------------

             Summary: 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)

Mime
View raw message