xsl-list
[Top] [All Lists]

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

2010-06-14 03:30:19
On Mon, Jun 14, 2010 at 12:58 AM, Alice Wei 
<elite(_dot_)english(_at_)gmail(_dot_)com> 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

--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--