cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Grzegorz Kossakowski <>
Subject Re: More problems with implementing servlet services
Date Sun, 13 May 2007 21:12:12 GMT
Alexander Klimetschek pisze:
> Grzegorz Kossakowski schrieb:
>> Alexander, I guess that you forgot original Daniel's proposal [1]. 
>> Generator calling service can POST it a file that is not valid XML and 
>> that's main difference from transformer. One could write for example:
>> <map:match pattern="test5">
>>   <map:generate type="servletService" src="test.html">
>>     <map:parameter name="service" value="servlet:test2:/extract-html"/>
>>   </map:generate>
>>   <map:serialize type="xml"/>
>> </map:match>
>> where service would look like:
>> <map:match pattern="basic-service">
>>   <map:generate src="service-consumer:" type="html"/>
>>   <map:serialize type="xml"/>
>> </map:match>
>> [1]
> Sorry, I still don't get the point. Your example seems inconsistent 
> (calling "servlet:test2:/extract-html" and the service matches on 
> "basic-service"). 

Sorry, my mistake. It should be "extract-html" of course.

> Does it mean that the service takes care of making XML 
> from a non-XML source (the file test.html in the example)? Why is that a 
> requirement? Maybe you could explain the things that should happen in 
> this case step by step... ;-)

In this case content of test.html is POSTed to the service and is available to it by "service-consumer:"
Generator in service pipeline reads data from "service-consumer:" so this effectively means
that it reads "test.html" 
file, parsers it and returns SSAX stream representing html content back to the calling pipeline.

Service generator and its behavior fits current meaning of a generator component. Currently,
we call a component 
"generator" if it takes some input data (may it be non-XML) and emits SAX events based on
provided data, right?
Now, with service generator it means that generator redirects (posts) incoming raw data to
the service and expects SAX 
events as output that it will pass down to the pipeline.

I hope this helps.

Grzegorz Kossakowski

View raw message