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

Re: Blanchard's Law, was: The Browser Wars


xslt not a qname
At 10:34 AM -0400 10/23/02, John Cowan wrote:


>The XPath data model and the Infoset were made compatible thanks to a
>conspiracy between James Clark and myself.  I note that the XPath data
>model also does not forbid names made up of seven spaces, but you don't
>rant about that.
>

That's because I don't think it's true:

	XPath operates on an XML document as a tree. This section describes
	how XPath models an XML document as a tree. This model is conceptual
	only and does not mandate any particular implementation. The
	relationship of this model to the XML Information Set [XML Infoset]
	is described in [B XML Information Set Mapping].

	XML documents operated on by XPath must conform to the XML
	Namespaces Recommendation [XML Names].

There's no notion of a synthetic XPath data model that can somehow avoid
the constraints of well-formedness. I also note that in discussion of
the location path and expression syntax, things are normatively QNames
as defined in namespaces in XML (and by extension XML .10.) For example,

	A node test that is a QName is true if and only if the type of the
	node (see [5 Data Model]) is the principal node type and has an
	expanded-name equal to the expanded-name specified by the QName. For
	example, child::para selects the para element children of the
	context node; if the context node has no para children, it will
	select an empty set of nodes. attribute::href selects the href
	attribute of the context node; if the context node has no href
	attribute, it will select an empty set of nodes.

	A QName in the node test is expanded into an expanded-name using the
	namespace declarations from the expression context. This is the same
	way expansion is done for element type names in start and end-tags
	except that the default namespace declared with xmlns is not used:
	if the QName does not have a prefix, then the namespace URI is null
	(this is the same way attribute names are expanded). It is an error
	if the QName has a prefix for which there is no namespace
	declaration in the expression context.

There are many more cases I could cite.

I also note that in XSLT, well-formedness is also required (aside
from allowing document fragments). For instance, when discussing the
name attribute of the xsl:element element that creates a new element
with a particular name, the XSLT spec states:

	The name attribute is interpreted as an attribute value template. It
	is an error if the string that results from instantiating the
	attribute value template is not a QName.

Clearly, seven spaces is not a legal QName in XSLT. I'm not sure if this
language has been carefully inserted into every location in the XSLT
spec., but it's obviously the intent.

-- 

+-----------------------+------------------------+-------------------+
| Elliotte Rusty Harold | elharo@m... | Writer/Programmer |
+-----------------------+------------------------+-------------------+
|          XML in a  Nutshell, 2nd Edition (O'Reilly, 2002)          |
|              http://www.cafeconleche.org/books/xian2/              |
|  http://www.amazon.com/exec/obidos/ISBN%3D0596002920/cafeaulaitA/  |
+----------------------------------+---------------------------------+
|  Read Cafe au Lait for Java News:  http://www.cafeaulait.org/      |
|  Read Cafe con Leche for XML News: http://www.cafeconleche.org/    |
+----------------------------------+---------------------------------+

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.