[Home] [By Thread] [By Date] [Recent Entries]

  • To: "Chiusano Joseph" <chiusano_joseph@b...>
  • Subject: Re: Looking for an example of a name colliision
  • From: "Bob Foster" <bob@o...>
  • Date: Sun, 1 Jun 2003 00:01:33 -0500
  • Cc: Bill de hÓra <bill@d...>,<xml-dev@l...>
  • References: <ab7bdvs3gol4j4trlefsiq6g4bfbaou70f@4...> <3ED5B096.9080102@t...> <3ED6062E.4080403@b...> <014f01c326ba$5d609890$b6f5d3ce@L565> <3ED860C6.5060207@d...> <092601c327c7$d78d9060$1401a8c0@snobird> <3ED966D3.E76909C9@b...>

From: "Chiusano Joseph" <chiusano_joseph@b...>
> <Quote>
> <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. So I posited an author element
with a title attribute and two annotations also named "title". IOW:

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

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.

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.

Bob

> Kind Regards,
> Joe Chiusano
> Booz | Allen | Hamilton
>
> Bob Foster wrote:
> >
> > From: "Bill de hÓra" <bill@d...>
> > > Does anyone have an example of a collision that can only be solved,
> > > or even best be solved with XML Namespaces? A neccessary condition
> > > is ideal, but examples where namespace represents an optimal design
> > > decision will do. I'm asking for two reasons:
> > >
> > >   - in my work with XML I've never run across a collision problem
> > > that seemed to require namespaces. I wondering whether they're rare
> > > or whether the markup I dela with is unusual.
> > >
> > >   - I'm looking for markup that I can use for test cases and
> > > thinking about the matter.
> > >
> > > I went looking in the Namepsaces spec and found this example and an
> > > assertion:
> > >
> > > [[[
> > > <section><title>Book-Signing Event</title>
> > > <signing>
> > >    <author title="Mr" name="Vikram Seth" />
> > >    <book title="A Suitable Boy" price="$22.95" /></signing>
> > > <signing>
> > >    <author title="Dr" name="Oliver Sacks" />
> > >    <book title="The Island of the Color-Blind" price="$12.95"
> > > /></signing>
> > > </section>
> > >
> > > In this example, there are three occurrences of the name title
> > > within markup, and the name alone clearly provides insufficient
> > > information to allow correct processing by a software module
> > > ]]]
> > >
> > > It demonstrates no such thing to me. For example, here is the
> > > sufficient information:
> > >
> > >   /section/title
> > >   /section/signing/author@title
> > >   /section/signing/book@title
> > >
> > > I suspect this particular assertion about the insufficiency of
> > > traditional namespaces in the spec is false. I believe for it to be
> > > true, there would need to exist markup for which no keys could be
> > > computed to dilineate one element or attribute from another.
> >
> > You surely don't mean that no homonyms can exist that cannot be resolved
by
> > XPath? E.g.,
> >
> > <author title="Contracts" title="Professor" title="13">James
Vleek</author>
> >
> > where the first is the title of a paper, the second the title of the
author
> > and the third Title 13 of the US Code.
> >
> > Name collisions can easily arise in this way, where attributes are used
as
> > domain-specific annotations, like "foreign attributes" are used in XML
> > Schema and RELAX NG. An annotator in one domain cannot reasonably be
> > expected to avoid collisions with all other possible domains, even
though
> > they are all marking up the same elements.
> >
> > Bob
> >
> > When ideas fail, words come in very handy.  |  http://www.xmlbuddy.com
> > - Goethe
> >
> > -----------------------------------------------------------------
> > 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>


Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member