XML.orgXML.org
FOCUS AREAS |XML-DEV |XML.org DAILY NEWSLINK |REGISTRY |RESOURCES |ABOUT
OASIS Mailing List ArchivesView the OASIS mailing list archive below
or browse/search using MarkMail.

 


Help: OASIS Mailing Lists Help | MarkMail Help

[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index]
RE: [xml-dev] Problems restricting UBL's AddressType complexType

I am finalizing a schema for public events, the latest version of which is
located here: http://groups.sims.berkeley.edu/EventCalendar/

It reuses UBL 1.0's AddressType, but unfortunately because of some weird
constraints on one of the UBL schemas (see emails below), even though I
didn't want to, I had to completely cut out CountrySubentityCode
(http://docs.oasis-open.org/ubl/cd-UBL-1.0/xsd/common/UBL-CommonAggregateCom
ponents-1.0.xsd) from my restriction
(http://groups.sims.berkeley.edu/EventCalendar/PreUCBEvents.xsd) of the UBL
AddressType. The work-around was that instead the CountrySubentity
(http://docs.oasis-open.org/ubl/cd-UBL-1.0/xsd/common/UBL-CommonBasicCompone
nts-1.0.xsd) element, which is also part of AddressType, could be used to
list names of states. 

However, now I'm realizing now that since CountrySubentity (as was
CountrySubentityCode) is a ComplexType (as was CountrySubentityCode), I
can't create an enumeration limiting these values in the schema. I read a
bit of Ken Holman's document on the UBL Codelist methodology
(http://www.oasis-open.org/committees/document.php?document_id=20313), but
it seems that it would involve doing another layer of non-schema validation
with something like genericode. This means I won't be able to use it (we are
using PHP's libxml only) and would have to validate the states using PHP in
our calendar application (which is really not ideal).

I would like to post this public events schema and encourage others to use
it. The calendar application I mentioned, which uses the model for public
events, will be open-source and available soon. I am all for re-using
existing, well-thought out models, but am wondering if re-using UBL's
AddressType is a mistake, and will make my public events schema less usable
to others (as it has to me)?


-----Original Message-----
From: George Cristian Bina [mailto:george@oxygenxml.com] 
Sent: Tuesday, January 10, 2006 1:29 AM
To: Allison Bloodworth
Cc: xml-dev@lists.xml.org
Subject: Re: [xml-dev] Problems restricting UBL's AddressType complexType

Hi Allison,

These are in general quite hard to spot errors. In your case the problem 
is with the local defined elements, ID and CountrySubentityCode. They 
are defined in the  UBL-CommonAggregateComponents.xsd schema as local 
elements inside the AddressType type and the schema/@elementFormDefault 
for that schema document is set to qualified, that means the local 
elements belong to the schema target namespace which is 
urn:oasis:names:specification:ubl:schema:xsd:CommonAggregateComponents-1.0.

Now in your schema you define ID and CountrySubentityCode also as local 
elements, you have elementFormDefault as qualified but no target 
namespace, that means the ID and CountrySubentityCode elements will be 
placed in no namespace. These elements from no namespace cannot be 
mapped to the elements with the same name but from the 
urn:oasis:names:specification:ubl:schema:xsd:CommonAggregateComponents-1.0 
namespace, thus the error.

The only thing you can do is to remove them, and if you remove both ID 
and CountrySubentityCode from your UCBAddressType type you will see that 
the schema is valid.

Hope that helps,
George
---------------------------------------------------------------------
George Cristian Bina
<oXygen/> XML Editor, Schema Editor and XSLT Editor/Debugger
http://www.oxygenxml.com


Allison Bloodworth wrote:
> 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-CommonAggregateCom
> 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@berkeley.edu
> 
> 
> 
> 
> -----------------------------------------------------------------
> 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>
> 

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




[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index]


News | XML in Industry | Calendar | XML Registry
Marketplace | Resources | MyXML.org | Sponsors | Privacy Statement

Copyright 1993-2007 XML.org. This site is hosted by OASIS