Web developers wiki ASP.NET Sitecore Sharepoint Kentico by Evident Interactive

XPath: get item from array

Modified: 2008/11/18 10:51 by jim - Categorized as: ASP.NET, Sitecore
Directly referencing an item in an array works:
<xsl:variable name="question" select="$questions/item[1]" />
Getting an item dynamically though a variable works only in some (undocumented) instances. Better is to use 'position()'

<xsl:variable name="question" select="$questions/item[position() = $rndNew]" />

 © Evident Interactive BV