File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Problem with xalan in a comparison along xpath axis

 
Nicolas Stern
Ranch Hand
Posts: 57
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi everybody,

I'm confronted with the following using xalan for a transformation: It seems that the result of a comparison between two values returns always true when I obtain the value along the following-sibling axe.

This is my source xml


.. and the stylesheet


Using xalan , both "if" statements evaluate to true. Output is always:


Using the xmlSpy internal xsl engine, the result of the comparison is as expected.

Thanks for any advice in advance.

Cheers - Nic
[ November 15, 2006: Message edited by: Nicolas Stern ]
 
Paul Clapham
Sheriff
Pie
Posts: 20208
26
MySQL Database
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Right. That's because "following-sibling::value" returns a node-set containing all the following siblings. And when you compare a string to a node-set, as you do later, the comparison is true if any of the nodes in the node-set are equal to the string.

Did you mean "following-sibling::value[1]"?
 
Nicolas Stern
Ranch Hand
Posts: 57
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Paul,

Thanks for your answer! restriction on the position of the value element is the solution. Topic can be closed.

I was not aware of the correct usage of following-sibling until I encountered this problem with this Xalan Version (2.7.0).

Still puzzled by the output difference when using Spy internal xsl engine and Xalan 2.7.

Thanks !
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic