Daniel Fagerstrom pisze:
Reinhard Poetz skrev:
Daniel Fagerstrom wrote:
What about reversing the logic: Instead of
>>> <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>
we could use
<map:match pattern="test5">
<map:generate type="servletService"
src="servlet:test2:/extract-html">
<map:parameter name="data" value="test.html"/>
</map:generate>
<map:serialize type="xml"/>
</map:match>
It doesn't make that much difference for generators, but would save
one line each for serializers and transformers.
WDYT?
It would save a line, but especially for the generator it would
obscure the function. For all other generators the src parameter is
used for *reading* stream input. With your proposal the data
parameter would instead get that role and the src parameter would be
used as something that is a service that you post something to. I
think that would be more confusing.
Also for the servlet service transformer and serializer, "src" sound
like something you read from rather than something you post to.
hmm, the "src" attribute of generators desribes, what is feed into the
component. In the case of a servlet service generator, the output
stream of a servlet is used as stream input.
Rather something that is transformed to SAX output.
The "data" parameter defines the content that is passed to the servlet
service. IMO that's not the starting point of the generator.
IMO it is ;)
The normal case:
Source ==[octet stream]==> Generator ==[SAX]==> ...
Servlet service generator as I see it:
Source ==[octet stream]==> Generator ==[SAX]==> ...
| ^
v |
ServletService
As you can see, the connection to the servlet service is something that
differ from the ordinary generator usage, and because of that it is
natural to put it in a parameter.
Maybe I agree with Daniel too often and it's not surprise but: +1 for the above
:-)
--
Grzegorz Kossakowski
http://reflectingonthevicissitudes.wordpress.com/