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

more QName madness

  • To: xml-dev@l...
  • Subject: more QName madness
  • From: "Simon St.Laurent" <simonstl@s...>
  • Date: Wed, 13 Nov 2002 19:08:45 -0500

w3c qname
The reportedly soon-to-turn-into-a-pumpkin XLink Working Group has
blessed us with yet another round of drafts for XPointer, releasing a
trio of Proposed Recommendations. [1-3]  The foundation PR, the XPointer
Framework[1], both opens up the prospect of other developers creating
XPointer schemes and burdens them with extra namespace baggage that the
W3C reserves only to itself the right to avoid.  

How?  The magic of QNames.  

Once upon a time, we had QNames which represented element and attribute
names, and, per the Namespaces in XML specification, processors
interpreted those compound names according to a declaration context
created by the surrounding document.  Despite many howls of protest and
years of discussion about what this mechanism really does and how it
works, QNames used as element and attribute names are now pretty tightly
integrated into the XML processing fabric.

For example:
<species xmlns="http://simonstl.com/ns/species
         xmlns:html="http://www.w3.org/1999/xhtml">
   <commonName>Cuckoo Possum</commonName>
   ....
   <description>
   <html:p>The Cuckoo Possum is a mythical creature whose habits are not
well known, except insofar as they involve invading the pouches of other
possum species to place their own young there.  The demented creator of
the cuckoo possum, <html:a href="http://simonstl.com">Simon
St.Laurent</html:a>, claims that it was just a joke for a book
example.</html:p>
   </description>
   ....
</species>

The next step forward in the use of QNames came when XPath needed a way
to reference elements and attributes that used QNames as identifiers,
and it was fairly clear that expanded names (roughly URI+localName)
weren't going to be popular.  XPath solved this riddle by letting
stylesheets use QNames inside of XPaths, using the namespace context
that applied to the point where the XPath appeared in the stylesheet.
(Of course, there were problems with using the default namespace, but
after being bitten once or twice or ten times, most XSLT developers
adjusted.)

For example:
<xsl:stylesheet version="1.0" 
  xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
  xmlns:s="http://simonstl.com/ns/species"
  xmlns:h="http://www.w3.org/1999/xhtml">
....
   <xsl:template match="/s:description/h:p">
   ....
   </xsl:template>
</xsl:stylesheet>

The next step forward in the use of QNames came when W3C XML Schema
decided that it would use QNames to identify types, not just element or
attribute names.  Processors of these QNames once again had to sort out
the context for the QName, but W3C XML Schema enshrined its own practice
in a new "QName" type for values, and QNames suddenly received use as
values independent of their use as element or attribute names.

....
 <xs:attribute name="html:a" type="xs:anyURI" />
....

The next step forward in the use of QNames came in XPointer, where it
became clear that reusing XPath in the xpointer() (and eventually
element()) scheme would require a notion of namespace context that XPath
didn't itself include.  To ensure that fragment identifiers which
depended on navigating element or attribute structures could find their
way, the XLink Working Group created the xmlns() scheme, letting
developers define namespace declarations inside of the fragment
identifier.  Robust URI references shouldn't depend on a particular
processing context, right?

....
   <link
xlink:href="http://simonstl.com/fairytale#xmlns(s=http://simonstl.com/ns
/species)xmlns(h=http://www.w3.org/1999/xhtml)xpointer(//s:description/h
:p/h:a)" >...</link>
....

The next step forward in the use of QNames came today, when the XLink
Working Group made a large change in the nature of XPointer scheme names
between Candidate and Proposed Recommendation status.  If you choose to
believe the Proposed Recommendation, XPointer scheme names are QNames,
and only the W3C is permitted to use unprefixed names in the effectively
default namespace.  QNames now exist as fragments of fragment
identifiers, forced to carry namespace declarations in the XPointer
parts to their left.

....
   <link
xlink:href="http://simonstl.com/cuckooPossum#xmlns(s=http://simonstl.com
/ns/species)xmlns(h=http://www.w3.org/1999/xhtml)xmlns(s=http://simonstl
.com/ns/xpath1)sxp:xpath1(//s:description/h:p/h:a)" >...</link>
....

At what point in all this forward motion did the process go over a
cliff?  There were clearly signs at the beginning of the journey, but it
is quite remarkable how far this trip has continued since.  It would in
fact be quite amusing, except that I'd actually like to use XPointers
sometime in the relatively near future and now consider them such an
incredible botch that it's time to throw out the specifications and let
someone else try again.

It's really quite something to see a gHorribleKludge grow and grow and
grow worse over the course of years.  Amazing, even before you pause to
consider that the W3C has reserved the rights to far less verbose usage
to itself when plans for future scheme development are cloudy at best.

[1] - http://www.w3.org/TR/xptr-framework/
[2] - http://www.w3.org/TR/xptr-element/
[3] - http://www.w3.org/TR/xptr-xmlns/


-------------
Simon St.Laurent - SSL is my TLA
http://simonstl.com may be my URI
http://monasticxml.org may be my ascetic URI
urn:oid:1.3.6.1.4.1.6320 is another possibility altogether

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.