You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@xalan.apache.org by Sergey Petrunia <se...@rwwws.ru> on 2002/04/12 21:51:43 UTC

A Xalan-C bug?

Hello,
 I am using latest Xalan-C and probably have found a bug.

Consider the xml file:
---test.xml---
<?xml version="1.0" encoding="UTF-8"?>
<root>
	<ex1>
		<btw>btw node text</btw>   
		<u>u node text</u>
		<child>child node text</child>
	</ex1>
</root>
---end of test.xml---

I've tried to select all "child" nodes that have "u" nodes among
preceding siblings and came up with the following xpath expression:
 //child[name(preceding-sibling::*)='u']

But SerializeNodeSet gives no matches for that expression:

SerializeNodeSet.exe test.xml /
"//child[name(preceding-sibling::*)='u']"

Warning: No nodes matched the location path
"//child[name(preceding-sibling::*)='u']".

Further expirements show that "child" node is returned only if "u" node
is the first sibling.
I've also tried this xpath expression in XML Spy and it yields the
"child" node no matter if "u" node is first sibling or not.

Is this a Xalan bug or XML Spy bug or what?

BR
--Sergey Petrunia