cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Sylvain Wallez <sylvain.wal...@anyware-tech.com>
Subject Re: WriteableSource to write anywhere
Date Mon, 25 Feb 2002 14:26:55 GMT
Jeremy Quinn wrote:

>At 12:22 am +0100 23/2/02, Sylvain Wallez wrote:
>
>>Jeremy, I also quickly updated the FileWritingTransformer so that it
>>uses any WriteableSource instead of just files. Could you please look at
>>it ? Another update would be also to the 'serializer' parameter fully
>>optional so that SAX events are sent directly to the result of
>>WriteableSource.getContentHandler(). This would for avoid parsing the
>>output of the serializer for native XML sources such as xmldb.
>>
>Hi Silvain,
>
This is spelled "S_y_lvain" :)

>I am just working on a new Transformer, WritableSourceTransformer, that
>will replace FileWritingTransformer and should be able to write to any
>writable source.
>
>What I do not understand right now is this:
>
>How do I tell if a particular WritableSource needs the services of a
>Serializer or not?
>
>'file://' needs one, but XMLDB will not right?
>
You don't need to know it. A WritableSource must implement both 
getContentHandler() and getOutputStream(). If a serializer is not 
specified to the WriteableSourceTransformer, the SAX events are sent 
directly to the WriteableSource, and the implementation knows if it 
needs (as file:) or not (as xmldb:) to use an internal serializer.

>At the moment, I am working on the assumption that is you have provided a
>Serializer parameter, you want to use a Serializer. But I think this is not
>the best way to do it!
>
This should be the way. But you will need to provide a serializer to the 
transformer only if the target storage format is not XML. In that case, 
this certainly makes the assumption that the target source is byte-based 
(like file) and not XML-based (like xmldb).

Now what are the uses cases where we don't want to write XML ? There may 
be cases where data is sent to the user or read from the request in a 
non-xml format (such as structured text like discussed earlier about 
Chaperon), but won't it be stored as XML ?

Sylvain

-- 
Sylvain Wallez
Anyware Technologies - http://www.anyware-tech.com




---------------------------------------------------------------------
To unsubscribe, e-mail: cocoon-dev-unsubscribe@xml.apache.org
For additional commands, email: cocoon-dev-help@xml.apache.org


Mime
View raw message