This is the mail archive of the
xsl-list@mulberrytech.com
mailing list .
RE: Way to find second instance?
- To: <xsl-list at lists dot mulberrytech dot com>
- Subject: RE: [xsl] Way to find second instance?
- From: "Michael Kay" <mhkay at iclway dot co dot uk>
- Date: Tue, 10 Jul 2001 22:51:34 +0100
- Reply-To: xsl-list at lists dot mulberrytech dot com
> If I do something similar to the following in ASP:
>
> objXSL.SelectSingleNode("//@match").Value = ".[whatever = 3]"
> Response.Write (objXML.TransformNode(objXSL))
>
> then it will find the first instance of the "match" attribute
> in my XSL
> document, right? If so, how can I find the second instance
> without parsing
> the XSL tree nodes.
You can do "//@match[2]", but of course both this and your original
expression will require the stylesheet to be parsed. It would certainly be
better programming practice to use a mroe specific expression that will
still work when another template rule is added to the stylesheet. In fact,
it would probably be better practice to tackle this problem completely
differently...
Mike Kay
Software AG
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list