Home. 
.

transparent

transparent

transparent

Altova Mailing List Archives


Re: Content Model for Restrictions

From: andrew.hodge@---.---.--
To: xmlschema-dev@--.---
Date: 9/2/2005 1:44:00 AM
Hi Henry,

I have double checked and done some more tests with our schemas (with some
curious results)

Regards
Andrew

>From Henry

I'll try to get some MSoft people to look at this (but first, could
you please confirm that MSXML rejects _all_ your examples) -- as
Kasimir said, your first example is equivalent to a restriction of
anyType, and that should work for sure.

I have double checked this example :

Fails with MSXML Vers 4 SP2
Fails with MSXML Vers 4 SP1
Fails with XMLSpy Vers 5 Rel 3
Passes with XMLSpy Vers 5 Rel 2

<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
xmlns:admin="urn:abs.gov.au/BusinessAdministrationSystems"
xmlns:tns="urn:abs.gov.au/BusinessProcessManagement"
targetNamespace="urn:abs.gov.au/BusinessProcessManagement"
elementFormDefault="qualified"
attributeFormDefault="unqualified">
      <xs:complexType name="TestEventPayload">
            <xs:sequence>
                  <xs:any namespace="##any" processContents="lax"
minOccurs="0" maxOccurs="unbounded"/>
            </xs:sequence>
      </xs:complexType>
      <xs:complexType name="RestTestEventPayload">
            <xs:complexContent>
                  <xs:restriction base="tns:TestEventPayload">
                        <xs:sequence>
                              <xs:element name="test1"/>
                           <xs:element name="test2"/>
                        </xs:sequence>
                  </xs:restriction>
            </xs:complexContent>
      </xs:complexType>
</xs:schema>

*********************************************************************

This schema fails with XMLSpy Rel 5 Vers 3 (illegal restriction of content
model for EventPayload)

However it passes with MSXML Vers 4 SP2, MSXML Vers 4 SP1, XMLSpy Vers 5
Rel 2.

<xs:schema targetNamespace="urn:abs.gov.au/BusinessProcessManagement"
xmlns:xs="http://www.w3.org/2001/XMLSchema"
xmlns:admin="urn:abs.gov.au/BusinessAdministrationSystems"
xmlns:tns="urn:abs.gov.au/BusinessProcessManagement"
elementFormDefault="qualified" attributeFormDefault="unqualified">
      <xs:include schemaLocation="
http://redirectory/infra:Administration_Infrastructure-V00.50"/>
      <xs:import namespace="urn:abs.gov.au/BusinessAdministrationSystems"
schemaLocation="http://redirectory/schema:Administration-V00.50"/>
      <xs:complexType name="Administration_Generic_Request_Service-V00.50">
            <xs:complexContent>
                  <xs:restriction base="tns:Event">
                        <xs:sequence>
                              <xs:element name="EventDiscriminator"
type="xs:string"/>
                              <xs:element name="EventPublisher"
type="xs:string"/>
                              <xs:element name="EventPayload">
                                    <xs:complexType>
                                          <xs:complexContent>
                                                <xs:restriction
base="tns:EventPayload">
                                                      <xs:sequence>
                                                            <xs:element
ref="admin:Task"/>
                                                            <xs:element
ref="admin:Status" minOccurs="0"/>
                                                      </xs:sequence>
                                                </xs:restriction>
                                          </xs:complexContent>
                                    </xs:complexType>
                              </xs:element>
                        </xs:sequence>
                  </xs:restriction>
            </xs:complexContent>
      </xs:complexType>
      <xs:element name="Administration_Generic_Request_Service-V00.50"
type="tns:Administration_Generic_Request_Service-V00.50"
substitutionGroup="tns:Event"/>
</xs:schema>

it is restricting this fragment (and it needs to go through multiple
includes to get there)

....
<xs:complexType name="EventPayload">
            <xs:sequence>
                  <xs:any namespace="##any" processContents="lax"
minOccurs="0" maxOccurs="unbounded"/>
            </xs:sequence>
      </xs:complexType>
      <xs:element name="EventPayload" type="tns:EventPayload"/>
      <xs:complexType name="Event">
            <xs:sequence>
                  <xs:element name="EventDiscriminator" type="xs:string"/>
                  <xs:element name="EventPublisher" type="xs:string"/>
                  <xs:element ref="tns:EventPayload"/>
            </xs:sequence>
      </xs:complexType>
      <xs:element name="Event" type="tns:Event" abstract="true"/>
....


*********************************************************************


With a single include I get :

Fails with MSXML Vers 4 SP2
Fails with MSXML Vers 4 SP1
Fails with XMLSpy Vers 5 Rel 3
Passes with XMLSpy Vers 5 Rel 2

<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
xmlns:admin="urn:abs.gov.au/BusinessAdministrationSystems"
xmlns:tns="urn:abs.gov.au/BusinessProcessManagement"
targetNamespace="urn:abs.gov.au/BusinessProcessManagement"
elementFormDefault="qualified" attributeFormDefault="unqualified">
      <xs:include schemaLocation="c:\data\bpm\schemas\TestSpy2005
Test1.xsd"/>
      <xs:complexType name="RestTestEventPayload">
            <xs:complexContent>
                  <xs:restriction base="tns:TestEventPayload">
                        <xs:sequence>
                              <xs:element name="test1"/>
                              <xs:element name="test2"/>
                        </xs:sequence>
                  </xs:restriction>
            </xs:complexContent>
      </xs:complexType>
</xs:schema>

<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
xmlns:admin="urn:abs.gov.au/BusinessAdministrationSystems"
xmlns:tns="urn:abs.gov.au/BusinessProcessManagement"
targetNamespace="urn:abs.gov.au/BusinessProcessManagement"
elementFormDefault="qualified" attributeFormDefault="unqualified">
      <xs:complexType name="TestEventPayload">
            <xs:choice minOccurs="0" maxOccurs="unbounded">
                  <xs:any namespace="##any" processContents="lax"/>
            </xs:choice>
      </xs:complexType>
</xs:schema>


*********************************************************************


Some more tests


*********************************************************************


Fails with MSXML Vers 4 SP2
Fails with MSXML Vers 4 SP1
Fails with XMLSpy Vers 5 Rel 3
Passes with XMLSpy Vers 5 Rel 2

<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
 xmlns:admin="urn:abs.gov.au/BusinessAdministrationSystems"
xmlns:tns="urn:abs.gov.au/BusinessProcessManagement"
targetNamespace="urn:abs.gov.au/BusinessProcessManagement"
elementFormDefault="qualified"
attributeFormDefault="unqualified">
      <xs:complexType name="TestEventPayload">
            <xs:sequence    minOccurs="0" maxOccurs="unbounded">
                  <xs:any namespace="##any" processContents="lax"/>
            </xs:sequence>
      </xs:complexType>
      <xs:complexType name="RestTestEventPayload">
            <xs:complexContent>
                  <xs:restriction base="tns:TestEventPayload">
                        <xs:sequence>
                              <xs:element name="test1"/>
                           <xs:element name="test2"/>
                        </xs:sequence>
                  </xs:restriction>
            </xs:complexContent>
      </xs:complexType>
</xs:schema>



*********************************************************************


Passes with MSXML Vers 4 SP2
Passes with MSXML Vers 4 SP1
Passes with XMLSpy Vers 5 Rel 2
Passes with XMLSpy Vers 5 Rel 3


<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
 xmlns:admin="urn:abs.gov.au/BusinessAdministrationSystems"
xmlns:tns="urn:abs.gov.au/BusinessProcessManagement"
targetNamespace="urn:abs.gov.au/BusinessProcessManagement"
elementFormDefault="qualified"
attributeFormDefault="unqualified">
      <xs:complexType name="TestEventPayload">
            <xs:sequence    minOccurs="0" maxOccurs="unbounded">
                  <xs:any namespace="##any" processContents="lax"/>
            </xs:sequence>
      </xs:complexType>
      <xs:complexType name="RestTestEventPayload">
            <xs:complexContent>
                  <xs:restriction base="tns:TestEventPayload">
                        <xs:sequence>
                              <xs:element name="test1"/>
                          <!--<xs:element name="test2"/>-->
                        </xs:sequence>
                  </xs:restriction>
            </xs:complexContent>
      </xs:complexType>
</xs:schema>


*********************************************************************


Fails with MSXML Vers 4 SP2
Fails with MSXML Vers 4 SP1
Fails with XMLSpy Vers 5 Rel 3
Passes with XMLSpy Vers 5 Rel 2

<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
 xmlns:admin="urn:abs.gov.au/BusinessAdministrationSystems"
xmlns:tns="urn:abs.gov.au/BusinessProcessManagement"
targetNamespace="urn:abs.gov.au/BusinessProcessManagement"
elementFormDefault="qualified"
attributeFormDefault="unqualified">
      <xs:complexType name="TestEventPayload">
            <xs:sequence>
                  <xs:any namespace="##any" processContents="lax"
minOccurs="0" maxOccurs="unbounded"/>
            </xs:sequence>
      </xs:complexType>
      <xs:complexType name="RestTestEventPayload">
            <xs:complexContent>
                  <xs:restriction base="tns:TestEventPayload">
                        <xs:sequence>
                              <xs:element name="test1"/>
                              <xs:element name="test1"/>
                        </xs:sequence>
                  </xs:restriction>
            </xs:complexContent>
      </xs:complexType>
</xs:schema>


*********************************************************************


Fails with MSXML Vers 4 SP2
Fails with MSXML Vers 4 SP1
Passes with XMLSpy Vers 5 Rel 3
Passes with XMLSpy Vers 5 Rel 2


<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
 xmlns:admin="urn:abs.gov.au/BusinessAdministrationSystems"
 xmlns:tns="urn:abs.gov.au/BusinessProcessManagement"
 targetNamespace="urn:abs.gov.au/BusinessProcessManagement"
elementFormDefault="qualified"
attributeFormDefault="unqualified">
      <xs:complexType name="TestEventPayload">
            <xs:choice  minOccurs="0" maxOccurs="unbounded">
                  <xs:any namespace="##any" processContents="lax"/>
            </xs:choice>
      </xs:complexType>
      <xs:complexType name="RestTestEventPayload">
            <xs:complexContent>
                  <xs:restriction base="tns:TestEventPayload">
                        <xs:sequence>
                              <xs:element name="test1"/>
                              <xs:element name="test2"/>
                        </xs:sequence>
                  </xs:restriction>
            </xs:complexContent>
      </xs:complexType>
</xs:schema>


*********************************************************************


Passes with MSXML Vers 4 SP2
Passes with MSXML Vers 4 SP1
Passes with XMLSpy Vers 5 Rel 3
Passes with XMLSpy Vers 5 Rel 2

<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
 xmlns:admin="urn:abs.gov.au/BusinessAdministrationSystems"
 xmlns:tns="urn:abs.gov.au/BusinessProcessManagement"
 targetNamespace="urn:abs.gov.au/BusinessProcessManagement"
elementFormDefault="qualified"
attributeFormDefault="unqualified">
      <xs:complexType name="TestEventPayload">
            <xs:choice  minOccurs="0" maxOccurs="unbounded">
                  <xs:any namespace="##any" processContents="lax"/>
            </xs:choice>
      </xs:complexType>
      <xs:complexType name="RestTestEventPayload">
            <xs:complexContent>
                  <xs:restriction base="tns:TestEventPayload">
                        <xs:sequence>
                              <xs:element name="test1"/>
                              <!--<xs:element name="test2"/>      -->
                        </xs:sequence>
                  </xs:restriction>
            </xs:complexContent>
      </xs:complexType>
</xs:schema>





-----------------------------------------------
ABS Web Site:  www.abs.gov.au


From lzzhang@g... Thu Sep 01 07:37:53 2005
Received: from wiggum.w3.org ([128.30.52.23])
	by frink.w3.org with esmtp (Exim 4.50)
	id 1EAjdw-0000uG


transparent
Print
Mail
Digg
delicious
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