Home. 
.

transparent

transparent

transparent

Altova Mailing List Archives


[XML Schema 1.1] Many questions about openContent

From: "Costello, Roger L." <costello@-----.--->
To: "'xmlschema-dev@--.---'" <-------------@--.--->
Date: 5/29/2009 3:25:00 PM
Hi Folks,

Here is an example of declaring a <Book> element with open content:

<element name="Book">
    <complexType>
        <openContent mode="interleaved">
            <any minOccurs="..." maxOccurs="..." />
        </openContent>
        <sequence>
            <element name="Title" type="string"/>
            <element name="Author" type="string" />
            <element name="Date" type="string"/>
            <element name="ISBN" type="string"/>
            <element name="Publisher" type="string"/>
        </sequence>
    </complexType>
</element>

Notice that I left unspecified the value of minOccurs and maxOccurs on the <any> element.

If I specify minOccurs="0" and maxOccurs="1" does it mean that 0-1 new elements can be inserted into the <sequence> content model? Or, does it mean that:

   Before the <Title> element there can be 0-1 new elements, and
   Before the <Author element there can be 0-1 new elements, and
   Before the <Date> element there can be 0-1 new elements, and
   Before the <ISBN> element there can be 0-1 new elements, and
   Before the <Publisher> element there can be 0-1 new elements, and
   After the <Publisher> element there can be 0-1 new elements.

If I specify minOccurs="1" and maxOccurs="1" does it mean that 1 new element must be inserted into the <sequence> content model? Or, does it mean that:

   Before the <Title> element there must be 1 new element, and
   Before the <Author element there must be 1 new element, and
   Before the <Date> element there must be 1 new element, and
   Before the <ISBN> element there must be 1 new element, and
   Before the <Publisher> element there must be 1 new element, and
   After the <Publisher> element there must be 1 new element.

If I specify minOccurs="0" and maxOccurs="unbounded" does it mean that 0-unbounded new elements can be inserted into the <sequence> content model? Or, does it mean that:

   Before the <Title> element there can be 0-unbounded new elements, and
   Before the <Author element there can be 0-unbounded new elements, and
   Before the <Date> element there can be 0-unbounded new elements, and
   Before the <ISBN> element there can be 0-unbounded new elements, and
   Before the <Publisher> element there can be 0-unbounded new elements, and
   After the <Publisher> element there can be 0-unbounded new elements.


Next, suppose I change the mode to 'suffix':

<element name="Book">
    <complexType>
        <openContent mode="suffix">
            <any minOccurs="..." maxOccurs="..." />
        </openContent>
        <sequence>
            <element name="Title" type="string"/>
            <element name="Author" type="string" />
            <element name="Date" type="string"/>
            <element name="ISBN" type="string"/>
            <element name="Publisher" type="string"/>
        </sequence>
    </complexType>
</element>

I believe mode="suffix" means that new elements must always be placed at the bottom of the <sequence> content model (after the <Publisher> element). Correct?

If I specify minOccurs="0" and maxOccurs="1" does it mean that 0-1 new elements can be inserted at the bottom of the <sequence> content model? 

If I specify minOccurs="1" and maxOccurs="1" does it mean that 1 new element must be inserted at the bottom of the <sequence> content model? 

If I specify minOccurs="0" and maxOccurs="unbounded" does it mean that 0-unbounded new elements can be inserted at the bottom of the <sequence> content model? 


Lastly, suppose I change the mode to 'none':

<element name="Book">
    <complexType>
        <openContent mode="none">
            <any minOccurs="..." maxOccurs="..." />
        </openContent>
        <sequence>
            <element name="Title" type="string"/>
            <element name="Author" type="string" />
            <element name="Date" type="string"/>
            <element name="ISBN" type="string"/>
            <element name="Publisher" type="string"/>
        </sequence>
    </complexType>
</element>

What does mode="none" mean? Does it mean:

    You cannot insert new elements into the <sequence> content model.

How is it different from this (no openContent specified):

<element name="Book">
    <complexType>
        <sequence>
            <element name="Title" type="string"/>
            <element name="Author" type="string" />
            <element name="Date" type="string"/>
            <element name="ISBN" type="string"/>
            <element name="Publisher" type="string"/>
        </sequence>
    </complexType>
</element>

Are they the same? If they are, why have mode="none"? What's its value?

/Roger


transparent
Print
Mail
Like It
Disclaimer
.

These Archives are provided for informational purposes only and have been generated directly from the Altova mailing list archive system and are comprised of the lists set forth on www.altova.com/list/index.html. Therefore, Altova does not warrant or guarantee the accuracy, reliability, completeness, usefulness, non-infringement of intellectual property rights, or quality of any content on the Altova Mailing List Archive(s), regardless of who originates that content. You expressly understand and agree that you bear all risks associated with using or relying on that content. Altova will not be liable or responsible in any way for any content posted including, but not limited to, any errors or omissions in content, or for any losses or damage of any kind incurred as a result of the use of or reliance on any content. This disclaimer and limitation on liability is in addition to the disclaimers and limitations contained in the Website Terms of Use and elsewhere on the site.

.
.

transparent

transparent