[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 munging
"Bob Foster" <bob@o...> wrote:
| From: "Chiusano Joseph" <chiusano_joseph@b...>

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


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.