DO NOT REPLY [Bug 47681] count function returning incorrect results
[email protected] Wed, 12 Aug 2009 06:31:30 -0700 (PDT)
| Newsgroups | gmane.comp.jakarta.taglibs.devel |
|---|---|
| Message-ID | <[email protected]> |
https://issues.apache.org/bugzilla/show_bug.cgi?id=47681 --- Comment #1 from Jason <[email protected]> 2009-08-12 06:31:27 PDT --- Just an addition to my original post. The "count($doc/world/country)" call will return zero (I think it should return 2. But when you put the $doc/world/country in a x:forEach tag it will behave correctly and result in two iterations...like this: <x:forEach select="$doc/world/country" var="test"> found a country<br> </x:forEach> This will result in "found a country<br>" being printed out twice..which is expected. It seems that once the expression is wrapped in the count function it is not handled properly. I noticed in the XPathUtil.adaptParamsForXalan method is only checking if the xpath variable starts with a '$' in order to create the appropriate Node and resolve the variable. In the case of the count($doc/world/country) expression this does not start with a '$' and will result in the method creating a DummyDocument instead of resolving the variable appropriately. Regards, Jason -- Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are the assignee for the bug.