Home. 
.

transparent

transparent

transparent

Altova Mailing List Archives


Re: Content Model for Restrictions

From: andrew.hodge@---.---.--
To: xmlschema-dev@--.---
Date: 8/31/2005 1:53:00 AM
Henry

In response to :

What you have is a classic case of a complex content model restricting
a starred wildcard, which is allowed, but only via a pretty obscure
route through the REC [1].  MS validators used to have a problem with
this but I think that got fixed some time back.

What validator are you using?

ht


Previously we have been using Microsoft=AE XML Core Services (MSXML) 4.0
Service Pack 1 (SP1)
and XMLSpy">XMLSpy Version 5 Release 2 which passed this type of restriction.

The restriction fails with  Microsoft=AE XML Core Services (MSXML) 4.0
Service Pack 2 (SP2)
and XMLSpy">XMLSpy Version 5 Release 3.

The MSXML error is :

Error Description msxml4.dll: /schema[1]/complexType
[position() = 2 and @name='RestTestEventPayload']
Invalid particle derivation by restriction.
Base type : '{urn:abs.gov.au/BusinessProcessManagement}TestEventPayload'
Derived type :
'{urn:abs.gov.au/BusinessProcessManagement}RestTestEventPayload'
ErrorNumber 213

The XMLSpy">XMLSpy error is :

"The content model of complex type tns:RestEventPayload
is not a vaild restriction of the content model tns:TestEventPayload"

Regards
Andrew Hodge



Original Query

Hi,
    my name is Andrew Hodge and I am an IT Architecture consultant for the
Australian Bureau of Statistics.  We have recently found some issues with
our use of restrictions when we have moved to using a new suite of schema
validators.  We have a federated hierarchical schema model to support
Business Process Management.  Below are some simple test cases we have
constructed to illustrate the issues we have come across.  I had a look at
Schemas Part 0 and Part 1 but did not see any obvious guidance on these
issues.  I was wondering if anyone could point me to an information source
or comment on aspects of the content model for these types of restrictions.
Regards
Andrew Hodge
Australian Bureau of Statistics
email - andrew.hodge@a...

This is an example of a case that has been working but now validation
fails.

<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>plexType>
</xs:schema>

It now fails with "The content model of complex type tns:RestEventPayload
is not a vaild restriction of the content model tns:TestEventPayload"

The following also fails.

<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>plexType>
</xs:schema>

If I comment out element test2 the validation passes

<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>

Interestingly if I change the schema to using choice instead of sequence in
TestEventPayload then it passes.

<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>

But it appears that this is not processed consistently in a hierarchical
schema structure.



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


From Paul.Vriend@d... Tue Aug 30 08:05:26 2005
Received: from wiggum.w3.org ([128.30.52.23])
	by frink.w3.org with esmtp (Exim 4.50)
	id 1EA17W-0000X0-Pr
	for xmlschema-dev@l...; Tue, 3


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