cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Christopher Oliver <res1c...@verizon.net>
Subject Re: JXTG Xpath returning NodeList
Date Sat, 24 Apr 2004 21:35:04 GMT
Tony Collen wrote:

> Leszek Gawron wrote:
>
>> 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.
>
I agree. I've changed the behavior of JXTemplateGenerator accordingly.

Regards,

Chris

Mime
View raw message