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
myapp-resources.zip
Description: Zip compressed data
_______________________________________________ oxf-users mailing list [EMAIL PROTECTED] http://mail.orbeon.com/mailman/listinfo/oxf-users
