This is the mail archive of the
xsl-list@mulberrytech.com
mailing list .
Re: Should "//ename[n]" mean "/descendant::e name"?]
- From: David Carlisle <davidc at nag dot co dot uk>
- To: xsl-list at lists dot mulberrytech dot com
- Cc: jwrobie at mindspring dot com
- Date: Thu, 20 Dec 2001 18:10:11 GMT
- Subject: Re: [xsl] Should "//ename[n]" mean "/descendant::e name"?]
- References: <5.1.0.14.0.20011220115659.023626f0@pop.mindspring.com>
- Reply-to: xsl-list at lists dot mulberrytech dot com
> I would love to come up with a definition
> that would allow //para[1] to mean the first paragraph in the document, but
> my proposed definition does not do that cleanly.
I accept yor later points that there are some aspects of xpath 1.0 that
are rather contrived and it may be acceptable to break things a bit,
but // is such core functionality you can't change this and call it
Xpath. You can't re-phrase your definition to make it cleaner as the
basic aim is, I fear, a non starter.
A Qname in Xpath, if it isn't being a function name or prefixed with an
axis or variable $ token, is always shorthand for the child axis. Your
definition (or any similar one) would break that.
In XSLT patterns, a // at the front of the expression never does anything
useful. This is a FAQ answer that your definittion would make incorrect.
Any stylesheet that currently uses // and [] together would silently
produce the wrong result, so detecting how many stylesheets you'd broken
would be difficult.
However I've just printed off a few hundred pages of xpath/xslt/xquery
documents, so something to read over Christmas, more comments later I
expect:-)
David
_____________________________________________________________________
This message has been checked for all known viruses by Star Internet
delivered through the MessageLabs Virus Scanning Service. For further
information visit http://www.star.net.uk/stats.asp or alternatively call
Star Internet for details on the Virus Scanning Service.
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list