Hi Benoit,
You'll want to use the single attribute on your jelly:xml tags in order to pull
a single node value. Otherwise,
+you'll get back a List of nodes (even if there is only one). Try this:
<x:set select="@name" var="name" single="true"/>
Hope This Helps,
Jason
On Sun, Nov 27, 2005 at 03:22:29PM +0100, [EMAIL PROTECTED] wrote:
> Hello,
> I want to output the result of the processing of a stylesheet to a file
> based on the value of an attribute.
> I retrieve the value of the attribute using an "<x:set..." from the XML
> tag library and I use it later.
> Insteadof giving me the value of the attribute as a string, It returns an
> object (DefaultAttribute).
> If I try to get the value of that object using "${name.getValue()}", the
> result is an empty string
>
> How can I do it ?
>
> The code sample is :
> <x:forEach select="xsd:complexType">
> <x:set select="@name" var="name"/>
> package test;
> <x:expr select="@name" />
> getName() result: <j:expr value="${name}"/>
> <j:expr value="${name.getValue()}"/>
> <j:file name="${name}.java">
> ...
>
> The name of the created file is something like :
> [EMAIL PROTECTED] [Attribute: name name value
> "empty"]]
>
> Thanks
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]