Details
-
Bug
-
Status: Resolved
-
Resolution: Incomplete
-
1.6
-
None
-
None
-
Operating System: All
Platform: All
-
23933
Description
The following XPath
//descendant-or-self::Assertion[parent::Security][1]
When run over the following xml file
<Envelope>
<Security>
<Assertion id="First"/>
</Security>
<Security >
<Assertion id="Second"/>
</Security>
<Security >
<Assertion id="Third"/>
</Security>
</Envelope>
returns all three Assertion nodes. When the predicate [1] is changed to [2]
only the node with id="Second" is selected, ditto when [1] is replaced by [3]
only the third node is selected. Therefore there is an issue with the predicate
[1] being used. This is at odds with the java implementation's evaluation of
the same expression, which, as expected returns only one node when [1] is used.
Notes:
This issue is observed on Linux (kernel 2.4.7-10 and above), Win32(2000) and
Solaris (5.8).
The bug was seen in the last version of Xalan I was using (1.2) but is still
present in the current release (1.6). I am using the default xerces (2.3.0).
Here is a code snippet to clarify my usage.
XPathEvaluator theEvaluator;
XalanSourceTreeDOMSupport theSupport;
const XObjectPtr dataObj = theEvaluator.evaluate(
theSupport,
theContext,
theXPATH.c_str(),
theResolver);
if (dataObj->getType() != XObject::eTypeNodeSet)
return new MutableNodeRefList((const NodeRefList)dataObj->nodeset());
The context node is the document node. The prefix resolver has been extended in
my impl but since there are no namespaces in my simplified example this should
not be an issue.
If you need any more information then I will be happy to oblige.
Tony