Home. 
.

transparent

transparent

transparent

Altova Mailing List Archives


RE: Content Model for Restrictions

From: "Zafar Abbas" <zafara@---------.--->
To: <andrew.hodge@---.---.-->, <xmlschema-dev@--.--->
Date: 9/6/2005 3:32:00 AM
There are known issues regarding content model restriction checking in
MSXML 4.0 which will be addressed in the future version (MSXML 6.0). I
am listing results for the sample schemas below.

Example1/2/3: known issue, fixed in future release.

** some more tests **

Example4: MSXML fails this since it is an invalid restriction.
Example5: Valid restriction.
Example6: known issue, fixed in future release.
Example7: MSXML fails this since it is an invalid restriction.
Example8: Valid restriction.

Thanks,
Zafar Abbas

-----Original Message-----
From: xmlschema-dev-request@w... [mailto:xmlschema-dev-request@w...]
On Behalf Of andrew.hodge@a...
Sent: Wednesday, August 31, 2005 10:44 PM
To: xmlschema-dev@w...
Cc: ht@i...
Subject: Re: Content Model for Restrictions


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 K.Buchcik@4... Tue Sep 06 19:07:55 2005
Received: from lisa.w3.org ([128.30.52.41])
	by frink.w3.org with esmtp (Exim 4.50)
	id 1ECinT-0004Rl-4r
	for xmlschema-dev@l...; T


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