commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Paul Libbrecht <p...@activemath.org>
Subject Re: [jelly-xml] (solved) xml:copy outputs attributes as text also
Date Fri, 09 Jan 2004 20:59:51 GMT
Gilles,

There's a fair amount of possible variables that can bite you here.

Are you using jelly within maven ? If yes, this might be infamous 
output bugs of dom4j 1.4b8 which is used in maven (as the release broke 
with entities).

I would do something like logging the elements of your process (using 
the log taglib)... the dom4j' default-nodes toStrings are pretty 
impressing!
(and also expensive I think).

Paul


On 8-Jan-04, at 23:18 Uhr, Gilles Dodinet wrote:

> Gilles Dodinet wrote:
>
>> im trying to transform some documents with jelly:jsl in order to 
>> modify the attributes of a specific element ('item'), the rest of the 
>> document remaining unchanged. so i have something like that in my jsl 
>> file :
>>
>> <jsl:template select="*">
>>    <!-- if currentNode.name == 'item', apply item template, else do 
>> this : -->
>>    <x:copy select=".">
>>       <jsl:applyTemplates />
>>    </x:copy>
>> </jsl:template>
>>
>> the problem i face is that for elements different than 'item', 
>> attributes are outputed as text as shown below :
>>
>> <menu name="menu_1">menu_1 <<===== here's the error
>>      <item name="item 1" href="/item_1_link"> <<=== no error for item

>> transformation
>> </menu>
>
>
> i "solved" this problem by adding a template on text nodes and doing 
> this   <x:copy select=".">
>      <jsl:applyTemplates select="* | text()/>
> </x:copy>
>
> in the  template select="*".
>
> my jsl transfo is not very elegant but still works..
>
> -- gd
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: commons-user-help@jakarta.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-user-help@jakarta.apache.org


Mime
View raw message