W3C home > Mailing lists > Public > www-p3p-public-comments@w3.org > April 2000

Problems with content models in XML Schemas

From: Martin J. Duerst <duerst@w3.org>
Date: Tue, 04 Apr 2000 23:40:03 +0900
Message-Id: <4.2.0.58.J.20000404233926.03224b30@sh.w3.mag.keio.ac.jp>
To: www-p3p-public-comments@w3.org
In a meeting here I just learned from Dave Raggett that
it seems to be wrong to assume that XML schemas can express
occurrence constraints on elements inside another element.

This would mean that the current P3P XML Schema is wrong,
and that facilities of XML Schema are inappropriate.

P3P WG, please check this out with the XML Schema WG,
and keep others informed.

Here is some data:

A P3P <policy> contains exactly one <disclosure>, at
least one <statement>, possibly a single disputes-group,
and possibly some extensions. The P3P schema tries to express
this as follows
(http://www.w3.org/TR/2000/WD-P3P-20000211/#Appendix_schema):

              <element name='policy'>
               <type>
                <attribute name='entity'>
                 <datatype basetype='STRING'
                </attribute>

                 <element ref='disclosure' minOccurs='1'/>
                 <element ref='disputes-group' minOccurs='0'/>
                 <element ref='statement' minOccurs='1' maxOccurs='*'/>
                 <element ref='extension' minOccurs='0' maxOccurs='*'/>

               </type>
              </element>

on the other hand, Dave Raggett, with the help of Henry Thomson,
editor of the XML Schema Structures spec, came up with the following
for HTML <head>:

<!-- one title and no more than one base -->
   <type name="head" source="html:common">
     <element ref="html:head.misc"
        minOccurs="0" maxOccurs="*" />

     <group order="choice">
       <group order="seq">
         <element ref="html:title" />

         <element ref="html:head.misc"
            minOccurs="0" maxOccurs="*" />

         <group order="seq" minOccurs="0">
           <element ref="html:base" />

           <element ref="html:head.misc"
              minOccurs="0" maxOccurs="*" />

         </group>
       </group>

       <group order="seq">
         <element ref="html:base" />

         <element ref="html:head.misc"
            minOccurs="0" maxOccurs="*" />

         <element ref="html:title" />

         <element ref="html:head.misc"
            minOccurs="0" maxOccurs="*" />
       </group>
     </group>
   </type>


Dave said that this cannot be simplified to something like:

              <element name='head' source="html:common">
               <type>
                <attribute name='entity'>
                 <datatype basetype='STRING'
                </attribute>

                 <element ref='html:base' minOccurs='0' maxOccurs='1'/>
                 <element ref='html:title' minOccurs='1' maxOccurs='1'/>
                 <element ref='html:head.misc' minOccurs='0' maxOccurs='*'/>

               </type>
              </element>


Please check this out!


Regards,   Martin.
Received on Tuesday, 4 April 2000 11:11:35 GMT

This archive was generated by hypermail 2.2.0+W3C-0.1 : Tuesday, 21 September 2004 12:14:16 GMT