I'm trying to create a XSLT function that takes in an array and an integer (representing a position) and returns the element at the given position. This is what I have so far:
<xsl:function name="getArrayPosition" as="item()*">
<xsl:param name="position"/>
<xsl:param name="srcCodesArray" as="item()*"/>
<xsl:value-of select="$srcCodesArray[$position]"/>
</xsl:function>
My input will be something very simple, such as
<srcCodes>
<item>Test1</item>
<item>Test2</item>
</srcCodes>