[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] Re: Find the Position Index of Elements
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
|
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|