xml-xmlbeans-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Kevin Krouse" <kkro...@bea.com>
Subject RE: noupa, any and ant task options
Date Mon, 19 Jul 2004 20:45:17 GMT
You can avoid the UPA rule by using the -noupa flag to scomp, but it is
still an invalid schema according to the XMLSchema spec.  See
http://www.w3c.org/TR/xmlschema-1/#non-ambig for an explanation of UPA.
The non-uniqueness is between the unbounded "submission_id" element and
the any.

There are a few work-arounds, none of which is probably what you want:

1.) change all of the elements in the sequence to be
minOccurs=maxOccurs=1 and the xsd:any to be unbounded.

2.) change <xsd:any/> to <xsd:any namespace="##other"/> so only elements
from other namespaces can be added after "view_filter"

3.) change <xsd:any/> to be under it's own element:

  <xsd:element name="future_use" minOccurs="0">
    <xsd:complexType>
      <xsd:sequence>
        <xsd:any namespace="##other" maxOccurs="unbounded"/>
      </xsd:sequence>
    </xsd:complexType>
  </xsd:element>

4.) use substitution groups.


Hope that helps,

--k

-----Original Message-----
From: Mike Perham [mailto:Mike.Perham@webifysolutions.com] 
Sent: Monday, July 19, 2004 8:47 AM
To: xmlbeans-user@xml.apache.org
Subject: noupa, any and ant task options

<xsd:complexType name="DownloadEligibilityRequest">
  <xsd:sequence>
    <xsd:element name="context_key" type="xsd:string" minOccurs="1"
maxOccurs="1"/>
    <xsd:element name="submission_id" type="xsd:string" minOccurs="0"
maxOccurs="unbounded"/>
    <xsd:element name="view_filter" type="xsd:string" minOccurs="0"
maxOccurs="1"/>
    <xsd:any />
  </xsd:sequence>
</xsd:complexType>

This is a request from a web service client to the web service.  I'd
like to preserve as much backwards compatibility as possible since it is
possible the WSDL will change without the client changing.  To that end,
I added the any clause to the request and response types.

XMLBeans gives me a UPA error when I try to compile this with the
xsd:any in there.  Is there a right way to structure my schema to do
this or do I need to use the -noupa flag?  Also, I'm using the ant task
to build my beans so how do I pass the -noupa flag via the ant task?

- ---------------------------------------------------------------------
To unsubscribe, e-mail:   xmlbeans-user-unsubscribe@xml.apache.org
For additional commands, e-mail: xmlbeans-user-help@xml.apache.org
Apache XMLBeans Project -- URL: http://xml.apache.org/xmlbeans/


- ---------------------------------------------------------------------
To unsubscribe, e-mail:   xmlbeans-user-unsubscribe@xml.apache.org
For additional commands, e-mail: xmlbeans-user-help@xml.apache.org
Apache XMLBeans Project -- URL: http://xml.apache.org/xmlbeans/


Mime
View raw message