Leszek Gawron wrote:I agree. I've changed the behavior of JXTemplateGenerator accordingly.
Say you have this DOM you pass to a template:
<?xml version="1.0"?> <root> <property file="user.properties" />
<path id="all.cp"> <pathelement location="${build.classes}" /> <fileset dir="${cocoon.lib}"> <include name="*.jar"/> </fileset> <fileset dir="${jetty.lib}"> <include name="*.jar"/> </fileset> <fileset dir="${hsqldb.lib}"> <include name="*.jar"/> </fileset> <fileset dir="${lib}"> <include name="**/*.jar"/> <include name="**/*.zip"/> </fileset> </path> </root>
template follows: <?xml version="1.0" encoding="utf-8"?> <page xmlns:jx="http://apache.org/cocoon/templates/jx/1.0"> <content> #{document/root/path/fileset} </content> </page>
The result is : <?xml version="1.0" encoding="ISO-8859-1"?><page xmlns:jx="http://apache.org/cocoon/templates/jx/1.0"> <content> <fileset dir="${cocoon.lib}"> <include name="*.jar"/> </fileset> </content> </page>
Why doesn't it return all matching nodes and only the first one?
Hmm, what about #{document//root/path/fileset} ? I would expect #{document/root/path/fileset[1]} or whatever to only return the first node, this is indeed odd.
Regards,
Chris
