You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cocoon.apache.org by lp...@celp.de on 2002/12/12 00:19:17 UTC

XMLForm Howto tips'n tricks

That was quite an effort to make the xmlform examples
run. A problem was the xmlform-id in sitemap.xmap that
is referred as id in the xf:form tag in the input file.
The sitemap example in Step 5 of the howto is a bit
strange, there are different versions of the same part>

If you use different xmlform-ids, form-howto and
form-feedback, you need two different versions of
files like start.xml, where this id is used.
I introduced a directory wizard beside existing xmlform.
Here comes my version of the part in samples/xmlform/sitemap.xmap

Note !! that I commented out the validation, because I still have
library problems.
The redirections solve the problem of incorrect references,
e.g. I saw howto-wizard.html and also howto-wizard.

    <map:pipeline>
       <map:match pattern="">
          <map:redirect-to uri="wizard"/>
       </map:match>
       <map:match pattern="wizard.html">
          <map:redirect-to uri="wizard"/>
       </map:match>
       <map:match pattern="howto-wizard.html">
          <map:redirect-to uri="howto-wizard"/>
       </map:match>

       <map:match pattern="wizard">
          <map:act type="WizardAction">

             <!--
             <map:parameter name="xmlform-validator-schema-ns" 
value="http://www.ascc.net/xml/schematron"/>
             <map:parameter name="xmlform-validator-schema" 
value="schematron/wizard-xmlform-sch-report.xml"/> -->
             <map:parameter name="xmlform-id" value="form-feedback"/>
             <map:parameter name="xmlform-scope" value="session"/>
             <map:parameter name="xmlform-model" 
value="org.apache.cocoon.samples.xmlform.UserBean"/>

             <!-- Content transformation logic -->
             <map:generate src="wizard/{page}.xml"/>
             <map:transform type="xmlform" label="xml"/>
             <map:transform src="stylesheets/wizard2html.xsl"/>
             <map:transform src="context://stylesheets/xmlform2html.xsl"/>
             <map:serialize type="html"/>
          </map:act>
       </map:match>

       <map:match pattern="howto-wizard">
          <map:act type="HowtoWizardAction">

             <!--
             <map:parameter name="xmlform-validator-schema-ns" 
value="http://www.ascc.net/xml/schematron"/>
             <map:parameter name="xmlform-validator-schema" 
value="howto/schematron/howto-xmlform-sch-report.xml"/> -->
             <map:parameter name="xmlform-id" value="form-howto"/>
             <map:parameter name="xmlform-scope" value="session"/>
             <map:parameter name="xmlform-model" 
value="org.apache.cocoon.samples.xmlform.howto.HowToBean"/>

             <!-- Content transformation logic -->
             <map:generate src="howto-wizard/{page}.xml"/>
             <map:transform type="xmlform" label="xml"/>
             <map:transform type="log">
                <map:parameter name="logfile" value="myDebug.log"/>
                <map:parameter name="append" value="no"/>
             </map:transform>
             <map:transform src="stylesheets/wizard2html.xsl"/>
             <map:transform src="context://stylesheets/xmlform2html.xsl"/>
             <map:serialize type="html"/>
          </map:act>
       </map:match>

    </map:pipeline>




btw: the combination java 1.4 and cocoon cvs snapshot doesn't
even show the first page of the Cocoon2 Demo, at least on my
box. I still use cocoon-2.0.3. Your experiences?





-- 
Dipl.-Inform. Ludwig Prager / lpr@celp.de / www.celp.de
Marienstr. 13, 83530 Waldhausen, Germany / Phone: +49 8074 176619
81314 Munich PF, Germany / Phone: +49 89 7602075
Mobile:+49 173 362 96 01 / Fax: 0180 54 02 52 555 84



---------------------------------------------------------------------
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:     <co...@xml.apache.org>
For additional commands, e-mail:   <co...@xml.apache.org>