This is the mail archive of the
xsl-list@mulberrytech.com
mailing list .
Re: Problem with <a> conversion
- From: Jeni Tennison <jeni at jenitennison dot com>
- To: "Vasu Chakkera" <vasucv at hotmail dot com>
- Cc: xsl-list at lists dot mulberrytech dot com
- Date: Mon, 1 Jul 2002 11:26:04 +0100
- Subject: Re: [xsl] Problem with <a> conversion
- Organization: Jeni Tennison Consulting Ltd
- References: <F162dusluCBcKfExvWv0000373f@hotmail.com>
- Reply-to: xsl-list at lists dot mulberrytech dot com
Hi Vasu,
> If you are trying to get hold of the all the a elements in the xml
> document irrespective of where or under which element they appear
> ,you can use //a instead of the a under each of the elements..
That's true, but it's simpler to just use "a", as in:
<xsl:template match="a">
...
</xsl:template>
The pattern "//a" matches all 'a' elements that are descendants of a
root node. Since all 'a' elements in a document are always descendants
of a root node, you may as well just match all 'a' elements rather
than having the extra test of seeing whether they're descendants of
a root node.
The same goes for any pattern: no match attribute needs to start with
"//".
Note that matching with a pattern is different from selecting with an
expression. If you had to *select* all the 'a' elements in the
document, then you would have to use "//a".
Cheers,
Jeni
---
Jeni Tennison
http://www.jenitennison.com/
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list