[Freemarker-devel] Problem with //foo and Jaxen
Generates text that depends on changing data (like dynamic HTML).
Brought to you by:
revusky
From: Daniel D. <dd...@fr...> - 2003-12-22 09:42:13
|
I have run into the following *serious* problem when I'm using Jaxen XPath. XML: <a> <x>1</x> <b> <x>2</x> <x>3</x> </b> <x>4</x> </a> Template: <#list doc['//x'] as x> - ${x} </#list> Output: - 1 - 4 - 2 - 3 Instead of the expected: - 1 - 2 - 3 - 4 The API docs of org.jaxen.BaseXPath.selectNodes says: <quote> In most cases, nodes will be returned in document-order, as defined by the XML Canonicalization specification. The exception occurs when using XPath expressions involving the union operator (denoted with the pipe '|' character). </quote> So... what's going on? Jaxen bug? But such ugly? I have tried it with both 1.0 and latest 1.1 beta. -- Best regards, Daniel Dekany |