This is the mail archive of the
xsl-list@mulberrytech.com
mailing list .
RE: how to use // starting from the root, when i am few steps und er the root,
- To: xsl-list at mulberrytech dot com
- Subject: RE: how to use // starting from the root, when i am few steps und er the root,
- From: Tony Graham <tgraham at mulberrytech dot com>
- Date: Tue, 22 Aug 2000 16:11:57 -0400 (EST)
- References: <2BC52EF1968FD211B3AB00805FE6FE8203D22E5B@uspalx21>
- Reply-To: xsl-list at mulberrytech dot com
At 22 Aug 2000 19:06 +0200, Spychalski, Frank wrote:
> ->-----Original Message-----
> ->From: David Allouche [mailto:david@ansible.xlii.org]
> ->Subject: RE: how to use // starting from the root, when i am few steps
> ->und er the root,
>
> Hi,
>
> ->PS: As far as I know, select="///element... is not legal.
>
> I didn't find anything that said /// is illegal. It works fine with my
> version of Xalan...
> And I think it's more logical to write /// than to write //, because for me
> the first slash represents the root element and the second and third are the
> short version for descendant-or-self, if you look at // you don't know (ok
'//' is the abbreviated syntax for '/descendant-or-self::node()/'.
See how the expansion contains two '/' that are used to delimit
location path steps, and that there is both an axis specifier
('descendant-or-self::') and a node test ('node()') between the
delimiters. You need both an axis specifier and a node test to make a
minimal location path step in XPath's full syntax. (Location path
steps also include zero or more predicates.)
Expanding '///' gets you '/descendant-or-self::node()//' (or
'//descendant-or-self::node()/'). Maybe Xalan is recursively
expanding any '//' to get you
'/descendant-or-self::node()/descendant-or-self::node()/', which is
legal full syntax, but I don't know that it's proper to use the middle
'/' in '///' twice like that. If Xalan does evaluate '///' as
'/descendant-or-self::node()/descendant-or-self::node()/', the
expression is going to slow down your processing even more than the
single '//' does.
> YOU do know, but the average user doesn't) if it's starting at the root
> element or if it has the meaning of .//
> But thats just my 2c.
It makes sense to me that "//" starts at the root because of its
leading "/", and it makes sense to me that ".//something" or, for
example, "PLAY//TITLE" doesn't.
Of course, the average user can also download the XSLT and XPath Quick
Reference at http://www.mulberrytech.com/quickref/.
Regards,
Tony Graham
======================================================================
Tony Graham mailto:tgraham@mulberrytech.com
Mulberry Technologies, Inc. http://www.mulberrytech.com
17 West Jefferson Street Direct Phone: 301/315-9632
Suite 207 Phone: 301/315-9631
Rockville, MD 20850 Fax: 301/315-8285
----------------------------------------------------------------------
Mulberry Technologies: A Consultancy Specializing in SGML and XML
======================================================================
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list