xsl-list
[Top] [All Lists]

[xsl] Find the Position Index of Elements‏‏

2010-06-13 14:43:40
Hi,

I have an XML snippet as in the following:

<music_songs>
  <song>
    <title>(I Just) Died In Your Arms</title>
    <category>Rock</category>
    <album>80 Popular Hits</album>
    <artist>Cutting Crew</artist>
    <date added="03-24-2009"/>
  </song>
  </music_songs>

This is one of the songs out of categories I have in my xml file, and
currently I use XPath expression as in the following:
/music_songs/song[category='Rock' as an example to find all the songs
in the Rock category.

I need to also be able to pull the position index of the song elements
that I pull from the above expression, and use that in VB.NET for
process. I tried using count(), position(), but they seem to be able
to detect, but they cannot give me a list like

1
2
3

for the index id of the search list. Is there a particular expression
I need to use here?

Thanks for your help.

--~------------------------------------------------------------------
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>
--~--