cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Reinhard Poetz <reinh...@apache.org>
Subject Re: XML Fragements in widgets
Date Wed, 11 May 2005 12:15:50 GMT
Sylvain Wallez wrote:
> Reinhard Poetz wrote:
> 
>>
>> I have the need for a widget that contains XML fragments. Those 
>> fragements should also be streamed as XML and not as strings. How can 
>> I achieve this? My first (and only) idea is implementing a new widget 
>> type (XMLWidget). Or are there better solutions?
> 
> 
> 
> I've had for months an unfinished and therefore uncommitted XML datatype 
> on my hard disk and the associated convertors. Want to finish them?

Sounds interesting but I'm not sure if this solves my problem. If I have a 
widget that has the value "<someXML>bla</someXML>" I need it serialized as

<fi:field>
   <fi:value>
     <someXML>bla</someXML>
   </fi:value>
</fi:field>

and not as

<fi:field>
   <fi:value>
     &lt;someXML&gt;bla&lt;/someXML&gt;
   </fi:value>
</fi:field>

After looking at Field.generateSAXFragement() (line 405) I don't think that a 
special datatype or a convertor can help here as only the string representation 
of the value is passed to the content handler:

contentHandler.characters(stringValue.toCharArray(), 0, stringValue.length());

Therefore my conclusion that I need a special XML widget that can produce more 
than character events, right?

-- 
Reinhard Pötz           Independent Consultant, Trainer & (IT)-Coach 

{Software Engineering, Open Source, Web Applications, Apache Cocoon}

                                        web(log): http://www.poetz.cc
--------------------------------------------------------------------


Mime
View raw message