Home. 
.

transparent

transparent

transparent

Altova Mailing List Archives


RE: [XML Schema 1.1] What does the "appliesToEmpty" attribute mean?

From: "Costello, Roger L." <costello@-----.--->
To: "xmlschema-dev@--.---" <-------------@--.--->
Date: 6/1/2009 8:27:00 PM
Thanks again Michael.

I'd like to confirm my understanding. 

Consider this element with empty content (but it has an attribute):

    <element name="image">
        <complexType>
           <attribute name="href" type="anyURI" />
        </complexType>
    </element> 

In an instance document we can have this:

    <image href="http://wwww.maps.org/boston.gif" />

Now, suppose the image element is declared in a schema that has defaultOpenContent with appliedToEmpty="true":

    <xs:defaultOpenContent mode="interleave" appliesToEmpty="true">
        <xs:any />
    </xs:defaultOpenContent>

Then in the instance document I can put extension elements *within* the <image> element:

    <image href="http://wwww.maps.org/boston.gif">
        <ex:comment>My home town</ex:comment>
    </image>

Conversely, if appliesToEmpty="false":

    <xs:defaultOpenContent mode="interleave" appliesToEmpty="false">
        <xs:any />
    </xs:defaultOpenContent>

Then in the instance document I cannot put extension elements *within* the <image> element.

Is that correct?

/Roger

-----Original Message-----
From: Michael Kay [mailto:mike@s...] 
Sent: Monday, June 01, 2009 12:27 PM
To: Costello, Roger L.; xmlschema-dev@w...
Subject: RE: [XML Schema 1.1] What does the "appliesToEmpty" attribute mean? What does it do?

When you have a defaultOpenContent in a schema document, this switch
determines whether the open content is allowed even on elements whose
content model is empty.

Section 3.4.2.3.3 clause 5 makes this clear: if a complex type does not
define its own <openContent>, then it is taken from the
<defaultOpenContent>, provided that either the content model is non-empty,
or the content model is empty and defaultOpenContent/@appliesToEmpty is true

Regards,

Michael Kay
http://www.saxonica.com/
http://twitter.com/michaelhkay 

> -----Original Message-----
> From: xmlschema-dev-request@w... 
> [mailto:xmlschema-dev-request@w...] On Behalf Of Costello, Roger L.
> Sent: 01 June 2009 17:04
> To: xmlschema-dev@w...
> Subject: [XML Schema 1.1] What does the "appliesToEmpty" 
> attribute mean? What does it do?
> 
> 
> Hi Folks,
> 
> A search for "appliesToEmpty" in the structures' 
> specification yields 4 occurrences of this term, but no prose 
> describing its meaning.
> 
> What does "appliesToEmpty" mean? What does it do?
> 
> /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