One or more xforms:instance in a xforms model

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

One or more xforms:instance in a xforms model

Geoffroy-2
According to the specification of XForms, a xforms:model can have one or more xforms:instance. I can put one or more xforms:instance in xforms:model only if the xforms:model is in the view. Why?

##################### page-flow.xml #####################

<config xmlns="http://www.orbeon.com/oxf/controller"
        xmlns:xu="http://www.xmldb.org/xupdate">
    ...
    <page id="quotation" path-info="/quadriscan/quotation/" xforms="quotation/xforms-model.xml" view="quotation/view.xsl"/>
    ...
    <epilogue url="oxf:/config/epilogue.xpl"/>
</config>

##################### xforms-model.xml #####################

<xforms:model xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
        xmlns:xforms="http://www.w3.org/2002/xforms"    
        xmlns:xs="http://www.w3.org/2001/XMLSchema"
        xmlns:xi="http://www.w3.org/2003/XInclude"  
        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
    <xforms:submission method="post" encoding="multipart/form-data"/>

    <xforms:instance id="instance">
        <form>
            <action>form</action>
            <file filename="" mediatype="" size="" xsi:type="xs:base64Binary"/>
            <validation/>
            <delete/>
            <quotation>
                <quantity>800</quantity>
                ...
            </quotation>
        </form>
    </xforms:instance>
</xforms:model>

##################### view.xsl #####################

<xsl:stylesheet version="2.0" xmlns:ev="http://www.w3.org/2001/xml-events"
        xmlns:f="http://orbeon.org/oxf/xml/formatting"
        xmlns:local="http://orbeon.org/oxf/xml/local"
        xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
        xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
        xmlns:xxforms="http://orbeon.org/oxf/xml/xforms"
        xmlns:xhtml="http://www.w3.org/1999/xhtml"
        xmlns:xs="http://www.w3.org/2001/XMLSchema">
    <xsl:variable name="instance" as="element()" select="/root/form"/>
    <xsl:variable name="errors" as="element()" select="/root/errors"/>
    <xsl:template match="/">
        <xhtml:html>
            <xhtml:head>
                <xhtml:title>Devis Quadriscan</xhtml:title>
            </xhtml:head>
            <xhtml:body>
               ...
            </xhtml:body>
        </xhtml:html>
    </xsl:template>
</xsl:stylesheet>



--
You receive this message as a subscriber of the [hidden email] mailing list.
To unsubscribe: mailto:[hidden email]
For general help: mailto:[hidden email]?subject=help
ObjectWeb mailing lists service home page: http://www.objectweb.org/wws
Reply | Threaded
Open this post in threaded view
|

Re: One or more xforms:instance in a xforms model

Erik Bruchez
Administrator
[hidden email] wrote:

 > According to the specification of XForms, a xforms:model can have
 > one or more xforms:instance. I can put one or more xforms:instance
 > in xforms:model only if the xforms:model is in the view. Why?

Because if you use the "xforms" attribute on the <page> element
instead, you are runnning the OPS classic XForms engine, which does
not support multiple XForms models or instances.

If you plan to use the latest XForms functionality in OPS, you have to
use the new XForms engine, which requires you to embed XForms models
and instances into XHTML, under the <head> element. This is consistent
with how most XForms engines work.

-Erik



--
You receive this message as a subscriber of the [hidden email] mailing list.
To unsubscribe: mailto:[hidden email]
For general help: mailto:[hidden email]?subject=help
ObjectWeb mailing lists service home page: http://www.objectweb.org/wws