ASPN ActiveState Programmer Network
ActiveState
/ Home / Perl / PHP / Python / Tcl / XSLT /
/ Safari / My ASPN /
Cookbooks | Documentation | Mailing Lists | Modules | News Feeds | Products | User Groups


Recent Messages
List Archives
About the List
List Leaders
Subscription Options

View Subscriptions
Help

View by Topic
ActiveState
.NET Framework
Open Source
Perl
PHP
Python
Tcl
Web Services
XML & XSLT

View by Category
Database
General
SOAP
System Administration
Tools
User Interfaces
Web Programming
XML Programming


MyASPN >> Mail Archive >> xml-dev
xml-dev
Re: [xml-dev] Looking for an example of a name colliision
by Arjun Ray other posts by this author
Jun 1 2003 5:12PM messages near this date
Re: [xml-dev] Looking for an example of a name colliision | Re: [xml-dev] Looking for an example of a name colliision
"Bob Foster" <bob@[...].com>  wrote:
| From: "Chiusano Joseph" <chiusano_joseph@[...].com> 

|> > <author title="Contracts" title="Professor" title="13">James
|> > Vleek</author>
|> > </Quote>
|> >
|> > The "title" attribute above cannot be repeated.
| 
| Of course not, but the questioner asked for an example of a name collision
| that required namespaces for disambiguation. 

But namespaces (i.e. name munging via colonification) are not required for
disambiguation.

| So I posited an author element with a title attribute and two annotations 
| also named "title". 

The constraint that attribute names be distinct in a starttag is a problem
only if one unnecessarily assumes that all vocabulary specific names must
be syntactically visible.      
 
| <author title="Contracts" abc:title="Professor" xyz:title="13"> James
| Vleek</author> 

Or:

  <author title="Contracts" foo="Professor" bar="13" 
        abc="title foo"  xyz="title bar"> James Vleek</author>

"Required" or necessity of name munging is still not demonstrated.
 
| But I agree a not well-formed example detracts from the point, so here is
| exactly the same example using elements instead of attributes:
| 
| <author name="James Vleek"> 
|   <title> Contracts</title>
|   <abc:title> Professor</abc:title>
|   <xyz:title> 13</xyz:title>
| </author> 
| 
| Which would be well-formed, but ambiguous, without the namespaces.

Not at all.  Attributes to guide interpretation is actually a very common
(and sometimes even overused!) technique.  

Consider, for example, HTML's <INPUT> .  It has a 'type' attribute to tell
the difference between radio buttons, checkboxes, etc.  Processing code
follows the pattern:

   On GI="INPUT":
     if  type="radio"
       do this
     else if type="checkbox"
       do that
     ...

IOW, the GI by itself does not fully discriminate "meaning".  Nor, for
that matter, need it do so.  To think that it *must* is a fallacy.

Now, if INPUT can be differentiated by an attribute, why not TITLE
subelements?

  <author name="James Vleek"> 
    <title> Contracts</title>
    <title role="abc"> Professor</title>
    <title role="xyz"> 13</title>
  </author> 

This would be an example of in-schema differentiation.  

| Such examples arise out of a common use case, e.g., the "foreign elements"
| allowed by RELAX NG and XML Schema. A schema can be decorated with foreign
| elements from more than one domain; only the namespaces of the elements
| prevent collisions.

No.  An attribute to tell the difference has been doing the job nicely for
years, except, of course, when people forget about them in the name of a
convenient fallacy.


-----------------------------------------------------------------
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> 
Thread:
Arjun Ray
Rick Jelliffe
james anderson
james anderson
K. Ari Krupnikov
Bob Foster
Arjun Ray
Thomas B. Passin
Thomas B. Passin
Bob Foster
Arjun Ray
K. Ari Krupnikov
Arjun Ray
K. Ari Krupnikov
Thomas B. Passin
Simon St.Laurent
Jonathan Borden
Thomas B. Passin
K. Ari Krupnikov
Arjun Ray
Simon St.Laurent
Chiusano Joseph
Arjun Ray
Chiusano Joseph
Chiusano Joseph
Arjun Ray
Thomas B. Passin
K. Ari Krupnikov
Arjun Ray
John Cowan
Arjun Ray
Bob Foster
W. E. Perry
Arjun Ray
Chiusano Joseph
Chiusano Joseph
Chiusano Joseph
W. E. Perry
Chiusano Joseph
Thomas B. Passin
Arjun Ray
John Cowan
Arjun Ray
John Cowan
Arjun Ray
K. Ari Krupnikov
james anderson
Arjun Ray
james anderson
Arjun Ray
Rick Jelliffe
james anderson
Arjun Ray
Jonathan Borden
=?ISO-8859-1?Q?Bill_de_h=D3ra?=
Arjun Ray
W. E. Perry
Arjun Ray
Rick Jelliffe
james anderson
Arjun Ray
Rick Jelliffe
Arjun Ray
Rick Jelliffe
Arjun Ray
james anderson
Simon St.Laurent
james anderson
Rich Salz
Jaywanth
Seairth Jacobs
Joe Gregorio
Arjun Ray
Arjun Ray
John Cowan
Simon St.Laurent
Arjun Ray
Paul Prescod
Arjun Ray
Paul Prescod
Arjun Ray
Tim Bray
MURATA Makoto
Arjun Ray
J.Pietschmann
Arjun Ray
Jason Diamond
Tim Bray
Tim Bray
Simon St.Laurent
Joe Gregorio
Paul Prescod
W. E. Perry
james anderson
james anderson
james anderson
Jonathan Borden
Miles Sabin
Simon St.Laurent
Jonathan Borden
Simon St.Laurent
W. E. Perry
Jonathan Borden
Simon St.Laurent
Thomas B. Passin
Jonathan Borden
Miles Sabin
Simon St.Laurent
Simon St.Laurent
Simon St.Laurent
Simon St.Laurent
Simon St.Laurent
Jonathan Borden
=?ISO-8859-1?Q?Bill_de_h=D3ra?=
Jonathan Borden
Miles Sabin
=?ISO-8859-1?Q?Bill_de_h=D3ra?=
james anderson
=?ISO-8859-1?Q?Bill_de_h=D3ra?=
Tim Bray
james anderson
John Cowan
=?ISO-8859-1?Q?Bill_de_h=D3ra?=
Arjun Ray
W. E. Perry
james anderson
=?ISO-8859-1?Q?Bill_de_h=D3ra?=
Joe Gregorio
Joe English
Paul Prescod
Joe English
Arjun Ray
=?ISO-8859-1?Q?Bill_de_h=D3ra?=
Simon St.Laurent
Arjun Ray
Joe English
Simon St.Laurent
Simon St.Laurent
Arjun Ray

Privacy Policy | Email Opt-out | Feedback | Syndication
© ActiveState Software Inc. All rights reserved