Subject: Re: [xsl] characters in xsl From: Wendell Piez <wapiez@xxxxxxxxxxxxxxxx> Date: Thu, 11 Nov 2004 14:09:21 -0500 |
'//stone' is a 'better match' in the sense that it is more specific.
named node tests (on the child or attribute axis) get priority 0 e.g. "child::stone", "attribute::feather" simple node tests (wildcards such as *) get priority -0.5 e.g. "*", "text()" anything else gets priority 0.5
It will not match the root element if its name would be stone.
Thus not all 'stone' elements in the document, but all _child_ elements (= elements that have a parent) named 'stone'. It works in fact the same as './/stone', where the current element will not be included if it happened to be a 'stone' element as well.
To match or select the root element if it is stone, use '/stone'. To match any element stone, just use 'stone'.
To access any stone element in the document, even the root, (at any moment during the transformation), use '/descendant-or-self::stone'.
In short: it usually doesn't make sense to use // in match patterns. And keep in mind that //stone in select patterns don't include the root element.
Cheers, Wendell
====================================================================== Wendell Piez mailto:wapiez@xxxxxxxxxxxxxxxx Mulberry Technologies, Inc. http://www.mulberrytech.com 17 West Jefferson Street Direct Phone: 301/315-9635 Suite 207 Phone: 301/315-9631 Rockville, MD 20850 Fax: 301/315-8285 ---------------------------------------------------------------------- Mulberry Technologies: A Consultancy Specializing in SGML and XML ======================================================================
Current Thread |
---|
|
<- Previous | Index | Next -> |
---|---|---|
Re: [xsl] characters in xsl, Geert Josten | Thread | Re: [xsl] characters in xsl, Geert Josten |
Re: [xsl] XSLT - update attribute w, Ann Marie Rubin | Date | Re: [xsl] variable question, Bruce D'Arcus |
Month |