cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Tony Collen <colle...@umn.edu>
Subject Re: JXTG Xpath returning NodeList
Date Sat, 24 Apr 2004 20:35:11 GMT
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.

> same goes with i.e. #{document/root/*}

What is the nodeset you get back when you try this?

> 
> A feature or a bug ?

I guess it depends on if you ask the person who wrote the code or not ;)

Although, it seems that it appears to be a bug... time to open a new bug 
it seems...

Tony


Mime
View raw message