cancel
Showing results for 
Search instead for 
Did you mean: 

XSLT Question: xsl:for-each select="//MYELEMEMT[1]"

Former Member
0 Kudos

Hi everybody,

does anybody know, what [1] means?

Thanks Regards Mario

Accepted Solutions (0)

Answers (2)

Answers (2)

Former Member
0 Kudos

Thanks a lot!

prateek
Active Contributor
0 Kudos

Hi Mario,

[1] is the first index of MYELEMENT

it should also have an index [0].

<i>

[Reward if helpful]</i>

Regards,

Prateek

stefan_grube
Active Contributor
0 Kudos

Check this:

http://www.w3schools.com/xpath/xpath_examples.asp

<i>select the First book Node

The following example selects only the first book node under the bookstore element:

xmlDoc.selectNodes("/bookstore/book[0]")

If you have IE 5 or higher you can try it yourself

Note: IE5 and later has implemented that [0] should be the first node, but according to the W3C standard it should have been [1]!!

A Workaround!

To solve the [0] and [1] problem in IE5+, you can set the SelectionLanguage to XPath.

The following example selects only the first book node under the bookstore element:

xmlDoc.setProperty "SelectionLanguage", "XPath"

xmlDoc.selectNodes("/bookstore/book[1]")</i>

Regards

Stefan