Re: [xsl] Find the Position Index of Elements‏‏

Subject: Re: [xsl] Find the Position Index of Elements‏‏
From: Philip Fearon <pgfearo@xxxxxxxxxxxxxx>
Date: Mon, 14 Jun 2010 09:30:00 +0100
On Mon, Jun 14, 2010 at 12:58 AM, Alice Wei <elite.english@xxxxxxxxx> wrote:
>I am wondering if there is an xpath that could be created so I could
>print out 1, 2, and 3 along with the other text, even though my xml
>snippet
...
> don't have 1 indicated here. Is this possible?

So far as I understand your question, the answer is no, its not
possible - not with XPath 1.0.

In my first answer I attempted to explain that in XPath 1.0 you can't
achieve what you need with a single XPath expression.

You must first evaluate one XPath expression that returns the elements
you need, and then in your VB.NET, iterate through those elements, and
on each element use a futher XPath expression to evaluate its
position.

I'm in danger of falling into the pitfall of playing 'guess the
question', that said, if you need output (now or in the future) that's
a bit more meaningful than 'Result 1 Something', and maybe with some
additional formatting you will often be better off with XSLT rather
than a VB.NET XPath solution.

Phil Fearon.
http://qutoric.com

Current Thread