Skip to Content
0
Former Member
Aug 01, 2006 at 06:18 PM

explain

21 Views

Hi! I'm new to xsl. Can anyone explain me what does the below templete do. What values does itemIndex1 and intemIndex2 parameter hold.

<xsl:template name="hierarchy">

<!-- THIS EXTRACTS THE ITEM-CHILD PACKAGING RELATIONSHIP-->

<xsl:param name="loopControl"/>

<xsl:param name="itemIndex2"/>

<xsl:param name="sortedNodes"/>

<xsl:param name="unsortedNodes"/>

<xsl:variable name="followingSibling">

<xsl:value-of select="$sortedNodes/E1MARMM[$itemIndex2 + 1]"/>

</xsl:variable>

<xsl:variable name="precedingSibling">

<xsl:value-of select="$sortedNodes/E1MARMM[$itemIndex2 - 1]"/>

</xsl:variable>

<!-- detemine whether this element has any siblings -->

<xsl:variable name="onlyChild">

<xsl:choose>

<xsl:when test="string-length($followingSibling)=0 and string-length($precedingSibling)=0">

<xsl:value-of select="true()"/>

</xsl:when>

<xsl:otherwise>

<xsl:value-of select="should-return-empty-string"/>

</xsl:otherwise>

</xsl:choose>

</xsl:variable>

</sl:template