XSDs using atom:link's followed by <any> tags result in ambiguous errors in XSD validators

Bug #872416 reported by Peter Erik Mellquist
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenStack Identity (keystone)
Invalid
Undecided
Unassigned

Bug Description

XSDs using atom:link's followed by <any> tags result in ambiguous errors in XSD validators

Description:
Various Keystone XSD's define atom links followed by <any> attributes which cause XSD tools to report errors ( e.g. Complex Type error X is ambiguous ). This issue exists in a few Keystone XSDs including user.xsd, tenant.xsd & roles.xsd. This may work for the current Python Keystone reference implementation, but other tools and clients wishing to use these XSDs must hand patch these XSDs ( comment out specific atom link lines ) in order to avoid these errors.

Specific Example from user.xsd
.
.
    <complexType name="UserList">
        <sequence>
            <element name="user" type="identity:User" minOccurs="0" maxOccurs="unbounded"/>
            <element vc:minVersion="1.1" ref="atom:link" minOccurs="0" maxOccurs="unbounded" /> <<<<<< PROBLEM
            <any namespace="##other" processContents="lax" minOccurs="0" maxOccurs="unbounded" />
        </sequence>
        <anyAttribute namespace="##other" processContents="lax"/>
    </complexType>

XMLSpy reports error as ...
"The content model of complex type definition 'identity:UserList is ambiguous"

Hack / Work Around :

    <complexType name="UserList">
        <sequence>
            <element name="user" type="identity:User" minOccurs="0" maxOccurs="unbounded"/>
            <!-- <element vc:minVersion="1.1" ref="atom:link" minOccurs="0" maxOccurs="unbounded" /> --> <<< COMMENT OUT
            <any namespace="##other" processContents="lax" minOccurs="0" maxOccurs="unbounded" />
        </sequence>
        <anyAttribute namespace="##other" processContents="lax"/>
    </complexType>

Revision history for this message
Jorge L. Williams (jorgew) wrote :

This is not a bug. Looks like you are trying to process the XSD 1.1 schema with an XSD 1.0 implementation.

If possible, use an XSD 1.1 implementation. You'll get a more exact contract, as well as support for assertions etc. To learn more about XSD 1.1 see here:

http://www.xfront.com/xml-schema-1-1/

We build our schema so that they can be easily translated into XSD 1.0 sachems in case you're stuck with a XSD 1.0 implementation. There in an excellent XSLT that you can use to translate the schema to 1.0 here:

http://www.blackmesatech.com/2009/04/vcdoc.html

Documentation is here:

http://www.blackmesatech.com/2009/04/vcdoc.html

Make sure you set the vc.Version parameter to 1.0.

Revision history for this message
Jorge L. Williams (jorgew) wrote :

Whoops the XSLT is actually here:

http://www.blackmesatech.com/2009/04/xsd.vc.xsl

Changed in keystone:
status: New → Invalid
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.