[XML-DEV Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

Re: Looking for an example of a name colliision


name collision in xsd
<Quote>
in any document using the a1 vocabulary, how can "StateCode" in the
sense of the a2 vocabulary be used?  Well, just use it!
</Quote>

I think I should be a bit clearer: In my example, the element
"StateCode" (a US state and the state of a chemical element) was
referenced twice, and in each reference it was in 2 separate namespaces.
If the 2 schemas (agency 1 and agency 2) shared the same namespace
(perhaps an overall "superagency" namespace), then name collision would
occur. My example was intended to demonstrate a case in which namespaces
prevented element name collision (and I think/hope it did).

Kind Regards,
Joe Chiusano
Booz | Allen | Hamilton

Arjun Ray wrote:
> 
> "Chiusano Joseph" <chiusano_joseph@b...> wrote:
> 
> | <Quote>
> | could you then provide us an instance illustration?
> | </Quote>
> |
> | Sure - here it is. This is an agency's schema (agency 1) that includes
> | the vocabulary of agency 2.
> 
> Name collision at the *schema definition* level!?  This kind of thing was
> solved by ArchForms years ago.  You might even say that this was exactly
> why ArchForms were invented!  See, eg,
> 
>   http://www.isogen.com/papers/archintro.htm
> 
> | <xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema"
> |           xmlns:a1="http://www.agency1.gov"
> |           xmlns:a2="http://www.agency2.gov"
> |             targetNamespace="http://www.agency1.gov"
> |             elementFormDefault="qualified">
> |
> | ...[import of agency 2's schema goes here]...
> |
> |    <xsd:element name="Address">
> |           <xsd:complexType>
> |               <xsd:sequence>
> |                   <xsd:element ref="a1:Street"/>
> |                   <xsd:element ref="a1:City"/>
> |                   <xsd:element ref="a1:StateCode"/>
> |                   <xsd:element ref="a1:ZipCode"/>
> |                   <xsd:element ref="a1:Country"/>
> |             </xsd:sequence>
> |         </xsd:complexType>
> |     </xsd:element>
> 
> Or, for people who can sleep at night without a steady diet of pointy
> brackets:
> 
>  <!ELEMENT  Address (Street, City, StateCode, ZipCode, Country) >
> 
> |    <xsd:element name="ElementInformation">
> |           <xsd:complexType>
> |               <xsd:sequence>
> |                   <xsd:element ref="a2:Name"/>
> |                   <xsd:element ref="a2:StateCode"/>
> |                       ...[more stuff here]...
> |             </xsd:sequence>
> |         </xsd:complexType>
> |     </xsd:element>
> 
>   <?IS10744:arch name="http://www.agency2.gov"
>                  form-att="a2" ?>
> 
>   <!ELEMENT ElementInformation (Foo, Bar) >
>   <!ATTLIST Foo  a2   NAME  #FIXED  "Name" >
>   <!ATTLIST Bar  a2   NAME  #FIXED  "StateCode" >
> 
> For a demonstration of how this particular usecase was a non-problem even
> before the colonification bogosity was invented:
> 
>  http://www.nyct.net/~aray/sgml/demo/dept/
> 
> But that's using old-fashioned tools.  As I understand this example, the
> point seems to be: in any document using the a1 vocabulary, how can
> "StateCode" in the sense of the a2 vocabulary be used?  Well, just use it!
> Simply annotate the use with an attribute saying "Oh by the way, this is
> in the a2 sense".
> 
> Perhaps you mean that your *tools* have been coded to robotically examine
> GIs only?
> 
> Well, that's a problem with the tools, not the formalism, no?
> 
> -----------------------------------------------------------------
> 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://lists.xml.org/ob/adm.pl>
begin:vcard 
n:Chiusano;Joseph
tel;work:(703) 902-6923
x-mozilla-html:FALSE
url:www.bah.com
org:Booz | Allen | Hamilton;IT Digital Strategies Team
adr:;;8283 Greensboro Drive;McLean;VA;22012;
version:2.1
email;internet:chiusano_joseph@b...
title:Senior Consultant
fn:Joseph M. Chiusano
end:vcard

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
 

Stylus Studio has published XML-DEV in RSS and ATOM formats, enabling users to easily subcribe to the list from their preferred news reader application.


Stylus Studio Sponsored Links are added links designed to provide related and additional information to the visitors of this website. they were not included by the author in the initial post. To view the content without the Sponsor Links please click here.

Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.