commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Marcin Sarniak (JIRA)" <>
Subject [jira] Commented: (JXPATH-12) [jxpath] Descendant or self axis does not work correctly at root node
Date Thu, 04 Jan 2007 07:57:27 GMT


Marcin Sarniak commented on JXPATH-12:

Adding a patch proposition for this bug (patch.jxpath-12.txt). 

As written here before, bug actually appears when xpatch is like "//root".
It appears also when a dom is inside any java structure 
For example: map.put("test", new Document(new Element("root"))); xpatch for
"//root" would return null.

Exactly the same bug was both for JDom and Dom; both are fixed.

Modifies 4 files:

This patch is to latest version (2.2?), not to version 1.2, reported as affected here.

> [jxpath] Descendant or self axis does not work correctly at root node
> ---------------------------------------------------------------------
>                 Key: JXPATH-12
>                 URL:
>             Project: Commons JXPath
>          Issue Type: Bug
>    Affects Versions: 1.2 Final
>         Environment: Operating System: other
> Platform: Other
>            Reporter: Simon R?ss
>         Attachments:, patch.jxpath-12.txt
> Given the following XML document: <root id="1234"/>
> and the XPath: //root/@id/text().
> JXPath returns null instead of "1234".
> JXPathContext context = JXPathContext.newContext(doc);
> assertEquals(value, context.selectSingleNode("//root/@id/text()"));
> The attached JUnit test highlights the problem. It seems that JXPath does not
> find the root node if it is accessed with the axis descendant-or-self.

This message is automatically generated by JIRA.
If you think it was sent incorrectly contact one of the administrators:
For more information on JIRA, see:


To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message