It's also possible to only have the <map:generate/> as child of <map:select/> and <map:act/> and the rest comes after <map:select/>:

<map:match pattern="*">
<map:select type="parameter">
<map:parameter name="parameter-selector-test" value="{1}"/>
<!-- Case #1 -->
<map:when test="EquipmentType">
<map:act type="EquipmentTypeAction">
<!-- XMLForm parameters for the AbstractXMLFormAction -->
<map:parameter name="xmlform-validator-schema-ns"
value="http://www.ascc.net/xml/schematron"/>
<map:parameter name="xmlform-validator-schema"
value="{1}/schematron/{1}-validator.xml"/>
<map:parameter name="xmlform-id" value="form-insert"/>
<map:parameter name="xmlform-scope" value="session"/>
<map:parameter name="xmlform-model"
value="net.josema.xmtrader.forms.xmldb.recordings.equipment.{1}Bean"/>
<!-- original XMLForm document -->
<map:generate src="{../1}/{page}.xml"/>
</map:act>
</map:when>
<!-- Case #2, very very similar to the first one, it should be a better
way to choose between both -->
<map:when test="RecordingType">
<map:act type="RecordingTypeAction">
<!-- XMLForm parameters for the AbstractXMLFormAction -->
<map:parameter name="xmlform-validator-schema-ns"
value="http://www.ascc.net/xml/schematron"/>
<map:parameter name="xmlform-validator-schema"
value="{1}/schematron/{1}-validator.xml"/>
<map:parameter name="xmlform-id" value="form-insert"/>
<map:parameter name="xmlform-scope" value="session"/>
<map:parameter name="xmlform-model"
value="net.josema.xmtrader.forms.xmldb.recordings.equipment.{1}Bean"/>
<!-- original XMLForm document -->
<map:generate src="{../1}/{page}.xml"/>
</map:act>
</map:when>
</map:select>
<!-- populating the document with model instance data -->
<map:transform type="xmlform" label="debug, xml"/>
<!-- personalizing the look and feel of the form controls -->
<map:transform src="styles/wizard2html.xsl"/>
<!-- Transforming the XMLForm controls to HTML controls -->
<map:transform src="styles/xmlform2html.xsl"/>
<!-- sending the HTML back to the browser -->
<map:serialize type="html"/>
</map:match>

But for my eyes still everything seems to be the same except the action interna. Maybe it's better to use only one action and choosing there internally what to do?

Regards,

Joerg

Artur Bialecki wrote:
Check out the 	"Calling resources" on this page
http://xml.apache.org/cocoon/userdocs/concepts/sitemap.html
Maybe you can organize the 'meat' of your pipeline as
as a resource and just map:call it from your main pipeline.

Artur...


-----Original Message-----
From: Josema Alonso [mailto:alonso@;aafunky.com] Sent: November 4, 2002 12:57 PM
To: [EMAIL PROTECTED]
Subject: Re: dynamically choosing an action at runtime



Just use appropriate selector:
http://xml.apache.org/cocoon/userdocs/selectors/selectors.html

I already tried but haven't found a nice way of using them for this purpose.
I can make something like the pipeline below, but i have dozens of similar
cases and it doesn't seem like a good approach. Maybe I haven't understood
selectors well...


--------------------------------------
<!-- XMLForms pipeline -->
<map:pipeline>
<map:match pattern="*">
<map:select type="parameter">
<map:parameter name="parameter-selector-test" value="{1}"/>
<!-- Case #1 -->
<map:when test="EquipmentType">
<map:act type="EquipmentTypeAction">
<!-- XMLForm parameters for the AbstractXMLFormAction -->
<map:parameter name="xmlform-validator-schema-ns"
value="http://www.ascc.net/xml/schematron"/>
<map:parameter name="xmlform-validator-schema"
value="{1}/schematron/{1}-validator.xml"/>
<map:parameter name="xmlform-id" value="form-insert"/>
<map:parameter name="xmlform-scope" value="session"/>
<map:parameter name="xmlform-model"
value="net.josema.xmtrader.forms.xmldb.recordings.equipment.{1}Bean"/>
<!-- original XMLForm document -->
<map:generate src="{../1}/{page}.xml"/>
<!-- populating the document with model instance data -->
<map:transform type="xmlform" label="debug, xml"/>
<!-- personalizing the look and feel of the form controls -->
<map:transform src="styles/wizard2html.xsl"/>
<!-- Transforming the XMLForm controls to HTML controls -->
<map:transform src="styles/xmlform2html.xsl"/>
<!-- sending the HTML back to the browser -->
<map:serialize type="html"/>
</map:act>
</map:when>
<!-- Case #2, very very similar to the first one, it should be a better
way to choose between both -->
<map:when test="RecordingType">
<map:act type="RecordingTypeAction">
<!-- XMLForm parameters for the AbstractXMLFormAction -->
<map:parameter name="xmlform-validator-schema-ns"
value="http://www.ascc.net/xml/schematron"/>
<map:parameter name="xmlform-validator-schema"
value="{1}/schematron/{1}-validator.xml"/>
<map:parameter name="xmlform-id" value="form-insert"/>
<map:parameter name="xmlform-scope" value="session"/>
<map:parameter name="xmlform-model"
value="net.josema.xmtrader.forms.xmldb.recordings.equipment.{1}Bean"/>
<!-- original XMLForm document -->
<map:generate src="{../1}/{page}.xml"/>
<!-- populating the document with model instance data -->
<map:transform type="xmlform" label="debug, xml"/>
<!-- personalizing the look and feel of the form controls -->
<map:transform src="styles/wizard2html.xsl"/>
<!-- Transforming the XMLForm controls to HTML controls -->
<map:transform src="styles/xmlform2html.xsl"/>
<!-- sending the HTML back to the browser -->
<map:serialize type="html"/>
</map:act>
</map:when>
</map:select>
</map:match>
</map:pipeline>



---------------------------------------------------------------------
Please check that your question has not already been answered in the
FAQ before posting. <http://xml.apache.org/cocoon/faq/index.html>

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


---------------------------------------------------------------------
Please check that your question  has not already been answered in the
FAQ before posting.     <http://xml.apache.org/cocoon/faq/index.html>

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



---------------------------------------------------------------------
Please check that your question  has not already been answered in the
FAQ before posting.     <http://xml.apache.org/cocoon/faq/index.html>

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

Reply via email to