Re: [xml-dev] Vocabulary Combination and optional namespaces
by Arjun Ray other posts by this author
May 30 2003 6:05AM messages near this date
Re: [xml-dev] Vocabulary Combination and optional namespaces
|
Re: [xml-dev] Vocabulary Combination
Joe Gregorio <joe@[...].org> wrote:
| Well, in the given example there isn't an _XML_ problem, since we *know*
| that there won't be any name collisions.
Name collision is an illusion. The illusion stems from an ill-considered
application of *defaulted* understandings of the single vocabulary case to
that of multiple vocabularies.
Basically, when multiple vocabularies are in play, you can't automatically
assume - i.e. as a default - the vocabulary to which a generic identifier
(or attribute name) should be imputed; or for that matter, that there is
only one relevant generic identifier for the particular element. You need
control information associated with the use of each vocabulary at every
start tag (i.e. for each element structure):
- whether a generic identifier applies (for that vocabulary) and if so
where to get it; which *could* be the "expected" generic identifier
position in the tag but need not be.
- whether any attribute specifications apply, and if so, how to find
them (just like the gi identification consideration above).
- whether immediate text content is part of the vocabulary specific
partition of the document.
Note that the single vocabulary case is just a matter of defaulting these
three considerations ("Yes, the GI is where you ordinarily expect it to
be; yes, all the atribute specifications count as is; and yes, include the
text content") so that no *explicit* control information need be encoded
in any tag. (But you *do* have to declare this fact, somehow)
By contrast, when you already know that defaults *don't* work, you can use
the control information to shuffle things around so they don't get in each
other's way. This necessarily means having to find vocabulary specific
names in places other than the now obviously inapplicable defaults.
By way of illustration, consider this reworking of the example in the OP.
It's unnecessarily verbose, but it shows how control information can be
used to "disambiguate" as the author may desire:
<?xml-map vocab="http://www.w3.org/HTML/1998/html4"
gi-mapper="hn"
att-renamer="ha"
text-controller="ht" ?>
<?xml-map vocab="http://www.xml.com/books"
gi-mapper="xn"
att-renamer="xa"
text-controller="xt" ?>
<A hn="html">
<B hn="head"> <C hn="title">Book Review</></>
<D hn="body" xn="bookreview">
<E xn="title" ht="no"> XML: A Primer</>
<F hn="table">
<G hn="tr" foo="center" ha="align foo">
<H hn="td" xt="no"> Author</><I hn="td" xt="no">Price</>
<J hn="td" xt="no"> Pages</><K hn="td" xt="no">Date</></>
<L hn="tr" bar="left" ha="align bar">
<M hn="td" xn="author"> Simon St. Laurent</>
<N hn="td" xn="price"> 31.98</>
<O hn="td" xn="pages"> 352</>
<P hn="td" xn="date"> 1998/01</>
</> </></></>
Note that *none* of the syntactically visible names belong to either of
the two relevant vocabularies. They don't have to: the control attributes
completely reconstruct the vocabulary specific views.
If you want to use vocabulary specific names in syntactically visible
positions, you could do something like this:
<?xml-map vocab="http://www.w3.org/HTML/1998/html4"
gi-mapper="hn"
att-renamer="ha"
text-controller="ht"
auto-map="true" ?>
<?xml-map vocab="http://www.xml.com/books"
gi-mapper="xn"
att-renamer="xa"
text-controller="xt"
auto-map="false" ?>
<html>
<head> <title>Book Review</></>
<body xn="bookreview">
<title ha="!gi !nil" ht="no" xa="!gi !gi"> XML: A Primer</>
<table>
<tr align="center">
<td xt="no"> Author</><td xt="no">Price</>
<td xt="no"> Pages</><td xt="no">Date</></>
<tr align="left">
<td xn="author"> Simon St. Laurent</>
<td xn="price"> 31.98</>
<td xn="pages"> 352</>
<td xn="date"> 1998/01</>
</> </></></>
Note the <title> just under <body> ;-)
Any vocabulary specific view can be read off by following the pattern of
control attributes for that vocabulary only. Like I said, name collision
is an utter and complete illusion.
| The problem comes about if you tried to combine RSS with another XML
| vocabulary whose elements also resided in the nil namespace.
No problem as long as markup is used to tell the difference. Heck, that's
what markup is for!
The interesting fact is that not only are colons or multi-part names not
needed for this, but also such syntactically intrusive devices can
complicate or preclude solving the problem in the general case.
In fact, I've demonstrated a class of methods (using control attributes)
to solve these problems:
1. Allow any vocabulary to be mapped to any partition of the document.
2. Allow this for multiple vocabularies uniformly, catering to both
exclusion and overlap.
Not just that, I've done it with nary a colonified name in sight. Never
mind that I don't even have "xlink:href versus html:src" problems here!
And for that, I'm supposed to be a troll? Sheesh.
-----------------------------------------------------------------
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
|