Home. 
.

transparent

transparent

transparent

Altova Mailing List Archives


RE: [xml-dev] Problems restricting UBL's AddressType complexType

From: "Michael Kay" <mike@--------.--->
To: "'Allison Bloodworth'" <abloodworth@--------.--->,<xml-dev@-----.---.--->
Date: 1/10/2006 10:13:00 AM
You might find the Saxon error message slightly more informative:

>java com.saxonica.Validate -t -s
http://groups.sims.berkeley.edu/EventCalendar/UCBAddress.xsd

Error on line 8 of
http://groups.sims.berkeley.edu/EventCalendar/UCBAddress.xsd:
  The content model of the complex type UCBAddressType is not a valid
restriction of the
  content model of the type AddressType. Restricted type allows element ID
where the base
  type does not

This is a namespace problem. In the base type, the ID element is in the UBL
namespace. In the derived type, it's in no namespace.

I've never found a satisfactory answer to this problem. Basically, if you're
trying to define a restriction of a type containing local element
declarations, then your derived type has to be in the same namespace as the
original - which means in this case that you have to define a new type in a
namespace that you don't own.

Of course it would have been more helpful if the authors of the UBL base
schema had made the element declarations global.

Michael Kay
http://www.saxonica.com/


  

> -----Original Message-----
> From: Allison Bloodworth [mailto:abloodworth@b...] 
> Sent: 10 January 2006 03:26
> To: xml-dev@l...
> Subject: [xml-dev] Problems restricting UBL's AddressType complexType
> 
> Hi, 
> 
> I've spent several hours trying to figure out why I can't 
> restrict UBL's
> AddressType
> (http://docs.oasis-open.org/ubl/cd-UBL-1.0/xsd/common/UBL-Comm
> onAggregateCom
> ponents-1.0.xsd) to remove certain elements. My (currently 
> invalid) schema
> attempting to do this is here:
> http://groups.sims.berkeley.edu/EventCalendar/UCBAddress.xsd. 
> I am only
> trying use restriction to remove elements that are 
> minOccurs="0", and many I
> was successfully able to remove. However, when trying to 
> remove elements
> that are part of AddressType which look like this:
> 
> <xs:element name="ID" type="udt:IdentifierType" minOccurs="0" 
> maxOccurs="1">
> 
> I'm told by Oxygen that: 
> 
> Description: E derivation-ok-restriction.5.4.2: Error for type
> 'UCBAddressType'.  The particle of the type is not a valid 
> restriction of
> the particle of the base.
> 
> URL: http://www.w3.org/TR/xmlschema-1/#derivation-ok-restriction
> 
> AND
> 
> Description: E rcase-Recurse.2: There is not a complete 
> functional mapping
> between the particles.
> 
> URL: http://www.w3.org/TR/xmlschema-1/#rcase-Recurse 
> 
> 
> I read the spec and it *seems* that I've met all the 
> requirements, but the
> spec is a bit hard to read. I simply copied AddressType from 
> the UBL schema
> to begin building my restriction so I'm not sure what I could 
> be missing.
> Any help would be much appreciated!
>  
> Allison Bloodworth
> Principal Administrative Analyst
> e-Berkeley Program Office
> University of California, Berkeley
> (415) 377-8243
> abloodworth@b...
> 
> 
> 
> 
> -----------------------------------------------------------------
> The xml-dev list is sponsored by XML.org <http://www.xml.org>, an
> initiative of OASIS <http://www.oasis-open.org>
> 
> The list archives are at http://lists.xml.org/archives/xml-dev/
> 
> To subscribe or unsubscribe from this list use the subscription
> manager: <http://www.oasis-open.org/mlmanage/index.php>
> 
>


transparent
Print
Mail
Like It
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