You are viewing a plain text version of this content. The canonical link for it is here.
Posted to j-users@xerces.apache.org by Bernard Snyers <bs...@ionicsoft.com> on 2007/04/26 17:59:45 UTC

Schema Structure Bug in Xerces 2.9.0

The schema (published by OGC ) you may find under the location 
http://schemas.opengeospatial.net/gml/2.1.2/geometry.xsd) produces the 
following error using Xerces  J 2.9.0:

org.xml.sax.SAXException: rcase-RecurseLax.2: There is not a complete 
functional mapping between the particles.
derivation-ok-restriction.5.4.2: Error for type 'MultiLineStringType'.  
The particle of the type is not a valid restriction of the particle of 
the base.
rcase-RecurseLax.2: There is not a complete functional mapping between 
the particles.

This is also produced for the type MultiPointType and MultiPolygonType.

If we try to investigate, let's isolate the appropriate elements of the 
schemas

  <element name="geometryMember" type="gml:GeometryAssociationType"/>
  <element name="pointMember" type="gml:PointMemberType" 
substitutionGroup="gml:geometryMember"/>

<complexType name="GeometryCollectionType">
 <complexContent>
      <extension base="gml:AbstractGeometryCollectionBaseType">
        <sequence>
          <element ref="gml:geometryMember" maxOccurs="unbounded"/>
        </sequence>
      </extension>
    </complexContent>
  </complexType>
 
  <complexType name="MultiPointType">
   <complexContent>
      <restriction base="gml:GeometryCollectionType">
        <sequence>
      <element ref="gml:pointMember" maxOccurs="unbounded"/>
        </sequence>
        <attribute name="gid" type="ID" use="optional"/>
        <attribute name="srsName" type="anyURI" use="required"/>
      </restriction>
    </complexContent>
  </complexType>

According to the schema spec
3.9.6 , RecurseAsAGroup
    The geometryMember will be rewritten as
   <choice minOccurs="1" maxOccurs="Unbounded">
       <element ref="gml:geometryMember" minOccurs="1" maxOccurs="1" />
       <element ref="gml:pointMember" minOccurs="1" maxOccurs="1"  />
</choice>

    and the pointMember will be rewritten as
    <choice minOccurs='1" maxOccurs="1" >
      <element ref="gml:pointMember" minOccurs="1" maxOccurs="unbounded"/>
    </choice>     

Then applying choice::choice recurselax
1 (Occurence check is ok, because the first choice is unbounded
2 Is ok too because pointMember is in the same order (alone) and is the 
same particle as in the first choice.


To be validated by the current version of Xerces (the version 2.6.2 has 
also the same problem), the schema will have to be rewritten as

<complexType name="MultiPointType">
   <complexContent>
      <restriction base="gml:GeometryCollectionType">
        <sequence>
       <choice minOccurs="1" maxOccurs="unbounded">
              <element ref="gml:pointMember" minOccurs="1" maxOccurs="1/>
        </choice>
        </sequence>
        <attribute name="gid" type="ID" use="optional"/>
        <attribute name="srsName" type="anyURI" use="required"/>
      </restriction>
    </complexContent>
  </complexType>


I think it is a bug, but maybe I am wrongly interpreted the schema spec.

Bernard Snyers




---------------------------------------------------------------------
To unsubscribe, e-mail: j-users-unsubscribe@xerces.apache.org
For additional commands, e-mail: j-users-help@xerces.apache.org