Orbeon produces invalid schemas

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

Orbeon produces invalid schemas

ajw625
I have run into a problem when trying to use the Orbeon form schemas.  The schemas use the “all” element incorrectly.  If you look at the simplified schema below you can see that the “staging-area” tag is wrapping the repeating “staging-area_staging-repeat” tag within an “all” element.  The rules for an “all”element are:
•  Each element in the xsd:all group must occur zero or once; that is minOccurs and maxOccurs must each be 0 or 1
•  The xsd:all group must be the top level element of its type
•  The xsd:all group may contain only individual element declarations; no choices or sequences
<xs:schema xmlns:vc="http://www.w3.org/2007/XMLSchema-versioning" xmlns:xf="http://www.w3.org/2002/xforms" xmlns:xs="http://www.w3.org/2001/XMLSchema" vc:minVersion="1.1">
    <xs:element name="form">
        <xs:complexType>
            <xs:all>
                <xs:element name="staging-area">
                    <xs:complexType>
                        <xs:all>
                            <xs:element maxOccurs="unbounded" minOccurs="1" name="staging-area_staging-repeat">
                                <xs:complexType>
                                    <xs:all>
                                        <xs:element name="staging-area_staging-repeat_name"></xs:element>
                                        <xs:element name="staging-area_disturbed-area"></xs:element>
                                    </xs:all>
                                </xs:complexType>
                            </xs:element>
                            <xs:element name="staging-area_output-text"></xs:element>
                        </xs:all>
                    </xs:complexType>
                </xs:element>
            </xs:all>
        </xs:complexType>
    </xs:element>
</xs:schema>

The simplest solution here is to change all of the “all” elements to “sequence” elements.  The Orbeon developers may have avoided “sequence” because they didn’t want to enforce an order on the elements.  The schema would have to become significantly more complex to accomplish that.
Reply | Threaded
Open this post in threaded view
|

Re: Orbeon produces invalid schemas

ajw625
I hit post on the above message when I meant to hit preview. That was an email from a developer I am working with.

Can you tell us why xs:all is being used instead of sequence? Was this intentional?

Is Orbeon Forms using the schema to validate the XML at any point? I know that the REST API does not validate the XML against the schema. It seems to accept any valid XML.
Reply | Threaded
Open this post in threaded view
|

Re: Orbeon produces invalid schemas

Alessandro  Vernet
Administrator
Hi Andrew,

The schema is not used by Orbeon Forms to validate the XML, but can be used by external tools, and the XML produced when filling out forms created with Form Builder will match the schema.

Using xs:all instead of xs:sequence is intentional. We do this because the order of the elements for a given form isn't constant (see the 2 issues linked below).


The restriction you're referring to is only for 1.0 schema, but not for 1.1 schema. When possible, we generate a 1.0 schema, but in some cases we can't, and have to generate a 1.1 schema. In that case the schema is properly flagged with vc:minVersion="1.1" (see issue below).


And you'll let me know if I'm missing anything,

Alex

On Mon, Jul 6, 2015 at 9:19 AM, ajw625 <[hidden email]> wrote:
I hit post on the above message when I meant to hit preview. That was an
email from a developer I am working with.

Can you tell us why xs:all is being used instead of sequence? Was this
intentional?

Is Orbeon Forms using the schema to validate the XML at any point? I know
that the REST API does not validate the XML against the schema. It seems to
accept any valid XML.

--
View this message in context: http://discuss.orbeon.com/Orbeon-produces-invalid-schemas-tp4660189p4660190.html
Sent from the Orbeon Forms community mailing list mailing list archive at Nabble.com.

--
You received this message because you are subscribed to the Google Groups "Orbeon Forms" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].

--
You received this message because you are subscribed to the Google Groups "Orbeon Forms" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
--
Follow Orbeon on Twitter: @orbeon
Follow me on Twitter: @avernet