Skip to Content
author's profile photo Former Member
Former Member

explain

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

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

1 Answer

  • Posted on Aug 02, 2006 at 07:21 AM

    Hi Hemal,

    the template is called with parameter. One of this is named 'itemIndex2'. We dont have 'itemIndex1'. You can refer a variable with a $ ($itemIndex2). '$itemIndex2 + 1' is a adding operation.

    To understand you need to know the rest (other templates) of the stylesheet.

    Regards,

    Udo

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.