On 30.06.2004 12:40, Armaz Mellati wrote:

I have big trouble deciding transform-src on runtime based on some value I
get from an action and xsp.
The point is, by the time I enter the "match" I don't know what the filename
is. I need to extract it from my database. As you see I have tried to use session-attr-module. I set the
HTML_stylesheet attribute in my report.xsp. However it seems the pipeline reads the transform-src before running the
xsp. This behavior is very
unfortunate.


<map:match pattern="report">
        <map:generate type="serverpages" src="xsp/report.xsp"
label="content"/>
        <map:transform src="{session-attr:HTML_stylesheet}" label="debug" />
      <map:serialize type="html"/>
</map:match>


Is there any other way tha using session-attr-module. How can I pass the filename from an xsp or action on to the transformer ???

Additionally to the pure SoC issue g[R]eK mentioned the above is not possible and you are forced to use an action. The pipeline is built and later processed where xsp content generation obviously belongs to the processing phase while determining the src of the transformer belongs to the building phase. And at the method level: You have SAX events being pushed through the pipeline. The serverpage *immediately* calls the first method on the transformer, not when it is finished completely. So you probably grab a value that is not even set.


When using an action you should neither use session attributes but the action return type to get the value: The action returns a map, in this map you use a special key to store your param, this one one you can get in the map:transform/@src:

<map:match pattern="report">
  <map:act type="anAction">
    <map:generate type="serverpages" src="xsp/report.xsp"/>
    <map:transform src="{myMapKey}" label="debug"/>
    <map:serialize type="html"/>
  </map:act>
</map:match>

Joerg

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Reply via email to