Alexander Klimetschek pisze:
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=""):

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] http://article.gmane.org/gmane.text.xml.cocoon.devel/67487

--
Grzegorz Kossakowski
http://reflectingonthevicissitudes.wordpress.com/

Reply via email to