Thanks Alex,

It is working now.

I am trying to grasp the basic concepts of form processing with the OXF
platform. I am very familiar with Struts so I will use that
understanding as a base point for explaining my uncertainties.

As I see it the controller acts much like the Struts controller when
handling a request for the /credit-card example below:

    <page path-info="/credit-card"
        xforms="oxf:/credit-card/xform-model.xml"
        model="oxf:/credit-card/model.xpl"
        view="oxf:/credit-card/xform-view.xml"/>

It automatically instantiates an xforms-instance "bean"? as defined in
the xform-model.xml, creates the xform view to be sent to the browser by
processing the xform-view.xml and maps the form to the model(model.xpl)
for processing. When the form is submitted the OXF controller
automatically populates the xforms-instance and makes this instance
available for further processing as defined in the model pipeline. 

In your corrections of my buggy example in the model.xpl you simply pass
the output to the console using the processor below:

        <p:param type="input" name="instance"/>
        
        <p:processor uri="oxf/processor/null-serializer">
        <p:input name="data" href="#instance" debug="instance"/>
        </p:processor>

So this is taking the xforms-instance generated by the forms submit and
creating a "null-serializer" to process the input that simply dumps it
to the console. Before I continue with my explanation resulting in my
current problem I would like to know if you could point me to the
documentation on the available processor factories that outlines how to
reference them the parameters that they take and what their
functionality is. I read the User Guide and the "Processor Reference"
but still feel I need more. 

With the current example I thought I could append another processor to
transform the xforms-instance document to be viewed by the browser. What
I did is this:

        <p:param type="input" name="instance"/>
        <p:param type="output" name="result"/>
        
        <p:processor uri="oxf/processor/null-serializer">
        <p:input name="data" href="#instance" debug="instance"/>
        </p:processor>  
        
        <p:processor uri="oxf/processor/xslt"
xmlns:p="http://www.orbeon.com/oxf/pipeline";> 
                <p:input name="config" href="stylesheet.xsl"/> 
                <p:input name="data" href="#instance"/>
                <p:output name="data" ref="result"/> 
        </p:processor>

Is this right, content is dumped to the console but the page does not
change in the browser? If I have been correct so far this is where I am
lost.

Also in Struts form processing I always build a EditXXXFormAction and a
SaveXXXFormAction. With OXF does every form "Action Event" need to be
defined in a editModel.xpl and saveModel.xpl? Once I figure out why I
don't get output to the browser I want to edit an XML Instance and load
the xform with the instance data. How would that be achieved?

Can anyone point me to a xforms tag lib documentation?

Many thanks,

Greg





> -----Original Message-----
> From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED]
> On Behalf Of Alessandro Vernet
> Sent: Wednesday, September 24, 2003 8:38 PM
> To: OXF Users
> Subject: Re: My first OXF XForms app?
> 
> Hi Greg,
> 
> The attached ZIP file includes the files you just sent, with a few
> modifications as described below.
> 
> 1) In view.xpl, all the XPL elements must be in the XPL namespace
> (http://www.orbeon.com/oxf/pipeline). The "p:" prefix was missing on a
> few elements. This is why you were getting an error.
> 
> 2) It is possible to use the XForms input and XForms output processors
> directly. But in most cases you don't need to. The Web application
> controller deals with XForms input and output processors for you when
> you specify the XForms model with the "xforms" attribute of your page
> in controller.xml. So I just removed view.xpl.
> 
> 3) The XForms elements in the view were incorrectly nested, and some
> attribute values were incorrect. The errors come from our
> documentation, and I apologize for this. The documentation will be
> fixed in the next release of OXF, and you can find a correct
> xforms-view.xml in the attached archive.
> 
> 4) I added a model.xpl that just displays the XForms instance in the
> console. If you want to send the instance to a Web service, or do some
> other processing, you would do this in that model.xpl.
> 
> With these modifications, if you enter the number "1234123412341234",
> select "Mastercard", and enter "09/2005" as the expiration date, the
> instance below will be created:
> 
> <credit-card-info>
>      <number>1234123412341234</number>
>      <type>mastercard</type>
>      <expiration-date>09/2005</expiration-date>
> </credit-card-info>
> 
> Alex
> 
> 
> Greg Hess wrote:
> 
> > Hi All,
> >
> >
> >
> > I am trying to build my first OXF app from the XForm Processors
> > reference. The document refers to a credit-card-info example and
> > provides some examples of the xform-model, xform-view, rng schema
and
> > input and output processors. I am having difficulty putting these
pieces
> > together to form a functional app that would simply take the user
input
> > and display the resulting instance document.
> >
> >
> >
> > The error message I am getting is as follows:
> >
> >
> >
> > Error Probably namespace URI of tag "processor" is wrong (correct
one is
> "http://www.orbeon.com/oxf/pipeline";)(schema:
> http://www.orbeon.com/oxf/pipeline)
> >
> >
> >
> > I have set up the application as follows:
> >
> >
> >
> > */myapp-resources/config/*
> >
> >
> >
> > *-conroller.xml:*
> >
> >
> >
> > <config xmlns="http://www.orbeon.com/oxf/controller";
> > xmlns:xu="http://www.xmldb.org/xupdate";>
> >
> >     <files path-info="*.gif"/>
> >
> >     <files path-info="*.css"/>
> >
> >     <files path-info="*.js"/>
> >
> >     <files path-info="*.png"/>
> >
> >     <files path-info="*.jpg"/>
> >
> >     <files path-info="*.dtd"/>
> >
> >     <files path-info="*.wsdl"/>
> >
> >     <files path-info="*.html"/>
> >
> >
> >
> >     <page path-info="/credit-card"
> >
> >             xforms="oxf:/credit-card/xform-model.xml"
> >
> >         view="oxf:/credit-card/view.xpl"/>
> >
> >
> >
> > </config>
> >
> >
> >
> > */myapp-resources/credit-card/*
> >
> >
> >
> > *-xform-model.xml:*
> >
> > <xforms:model schema="schema.rng"
> > xmlns:xforms="http://www.w3.org/2002/xforms";>
> >
> >             <xforms:instance>
> >
> >                         <credit-card-info>
> >
> >                                     <number/>
> >
> >                                     <type>visa</type>
> >
> >                                     <expiration-date/>
> >
> >                         </credit-card-info>
> >
> >             </xforms:instance>
> >
> >             <xforms:submission
> > action="http://www.example.com/submit-card"; method="post"/>
> >
> > </xforms:model>
> >
> >
> >
> > *-schema.rng:*
> >
> > <element name="credit-card-info"
> > datatypeLibrary="http://www.w3.org/2001/XMLSchema-datatypes";>
> >
> >             <element name="number">
> >
> >                         <data type="string">
> >
> >                                     <param name="length">16</param>
> >
> >                                     <param
name="pattern">[0-9]*</param>
> >
> >                         </data>
> >
> >             </element>
> >
> >             <element name="type">
> >
> >                         <choice>
> >
> >                                     <value>visa</value>
> >
> >                                     <value>mastercard</value>
> >
> >                                     <value>amex</value>
> >
> >                         </choice>
> >
> >             </element>
> >
> >             <element name="expiration-date">
> >
> >                         <data type="string">
> >
> >                                     <param
> > name="pattern">[0-9]{2}/[0-9]{4}</param>
> >
> >                         </data>
> >
> >             </element>
> >
> >  </element>
> >
> >
> >
> > *-xform-view.xml:*
> >
> > <xforms:group xmlns:xforms="http://www.w3.org/2002/xforms";>
> >
> >             <xforms:input ref="credit-card-info"/>
> >
> >             <xforms:submit>
> >
> >                         <xforms:input ref="number"/>
> >
> >                         <xforms:select1 ref="type"
appearance="full">
> >
> >                                     <xforms:choices>
> >
> >                                                 <xforms:item>
> >
> >
> > <xforms:caption>Visa</xforms:caption>
> >
> >
> > <xforms:value>visa</xforms:value>
> >
> >                                                 </xforms:item>
> >
> >                                                 <xforms:item>
> >
> >
> > <xforms:caption>Mastercard</xforms:caption>
> >
> >
> > <xforms:value>mastercard</xforms:value>
> >
> >                                                 </xforms:item>
> >
> >                                                 <xforms:item>
> >
> >
> > <xforms:caption>American Express</xforms:caption>
> >
> >
> > <xforms:value>amex</xforms:value>
> >
> >                                                 </xforms:item>
> >
> >                                     </xforms:choices>
> >
> >                         </xforms:select1>
> >
> >                         <xforms:input ref="expiration-date"/>
> >
> >             </xforms:submit>
> >
> >   </xforms:group>
> >
> >
> >
> > *-view.xpl:*
> >
> > <p:config xmlns:p="http://www.orbeon.com/oxf/pipeline";>
> >
> >
> >
> >             <processor uri="oxf/processor/xforms-input">
> >
> >                         <input name="model" href="#xforms-model"/>
> >
> >                         <input name="request" href="#request"/>
> >
> >                         <output name="instance"
id="xform-instance"/>
> >
> >             </processor>
> >
> >
> >
> >             <processor uri="oxf/processor/xforms-output">
> >
> >                         <input name="model" href="#xforms-model"/>
> >
> >                         <input name="instance"
href="#xforms-instance"/>
> >
> >                         <input name="data" href="#data"/>
> >
> >                         <input name="config">
> >
> >                                     <config namespace-prefix="d"
> > namespace-uri="http://orbeon.org/oxf/xml/document"/>
> >
> >                         </input>
> >
> >                         <output name="data" id="html"/>
> >
> >             </processor>
> >
> > </p:config>
> >
> >
> >
> >
> >
> > Any help is greatly appreciated, I am trying to get a handle on
> > processing XForms and want to create one from scratch, I was trying
to
> > convert the xforms-text example to work with the credit-card-info
model
> > but was getting many errors so I thought it would be better to start
> > from scratch. If I am way off base with my implementation and anyone
> > could sugest an example I should start from that would be great.
> >
> >
> >
> > Cheers,
> >
> >
> >
> > Greg Hess
> >
> > *Software Engineer*
> >
> > *Wrapped Apps Corporation*
> >
> > 275 Michael Cowpland Dr.
> >
> > Suite 201
> >
> > Ottawa, Ontario
> >
> > K2M 2G2
> >
> > Tel: (613) 591 -7552
> >
> > Fax: (613) 591-0523
> >
> > 1 (877) 388-6742
> >
> > * <http://www.wrappedapps.com/>*
> >
> >
> >
> >
> >
------------------------------------------------------------------------
> >
> > _______________________________________________
> > oxf-users mailing list
> > [EMAIL PROTECTED]
> > http://mail.orbeon.com/mailman/listinfo/oxf-users


_______________________________________________
oxf-users mailing list
[EMAIL PROTECTED]
http://mail.orbeon.com/mailman/listinfo/oxf-users

Reply via email to