Grzegorz Kossakowski schrieb:
In generator we already use src attribute for different purpose.
Hmm, after looking at the proposed sitemap syntax in [1], I think it can be
optimized. I personally think a generator should only generate XML from some
kind of source. Doing two things (or 4 when including the POST request and
the response) at once makes it kinda difficult to understand:
<!-- This is a test of basic servlet services functionality
servletService generator makes a HTTP POST request on
servlet:test2:/basic-service.
Generator posts content of test.xml file and returns to the
pipeline result of service call.
-->
<map:match pattern="test5">
<map:generate type="servletService" src="test.xml">
<map:parameter name="service"
value="servlet:test2:/basic-service?caller=generator"/>
</map:generate>
<map:serialize type="xml"/>
</map:match>
The use of the transformer below seems more intuitive for me (when including
the shorter version using src=""):
<!-- This is a test of basic servlet services functionality
servletService transformer makes a HTTP POST request on
servlet:test2:/basic-service.
Transformer posts content of the incoming SAX stream (here it's
just content of test.xml file)
and returns to the pipeline result of service call.
-->
<map:match pattern="test6">
<map:generate src="test.xml"/>
<map:transform type="servletService"
src="servlet:test2:/basic-service?caller=transformer"/>
</map:transform>
<map:serialize type="xml"/>
</map:match>
[1]
http://svn.apache.org/repos/asf/cocoon/trunk/core/cocoon-servlet-service/cocoon-servlet-service-sample/src/main/resources/COB-INF/test1/sitemap.xmap
--
Alexander Klimetschek
http://www.mindquarry.com