AnsweredAssumed Answered

XSLT LOOP COUNTER

Question asked by sorrow on Jan 8, 2015
Latest reply on Jan 16, 2015 by sorrow

Hi,

I am trying to get a Loop# in this stylesheet.  If its on loop 1 than I want a parameter to say 1, if on loop 2 a parameter to say 2.......

 

This is the coding I am currently using below, but I cant find a way to do this.

 

Thanks for your help!

 

Scott

 

 

    <RESULTSET FOUND="">

         <xsl:for-each select="./BTI_OPM_BATCH_EXTRACT/LIST_BATCH_HDR/BATCH_HDR/LIST_SEQUENCE/SEQUENCE/SEQUENCE_LIST/SEQ">

           <xsl:if test="../../../../ROUT_CLASS='CUOL'">

          <xsl:variable name="LOOP" select="1"/>

           <ROW MODID="" RECORDID="">

            <COL><DATA><xsl:value-of select="../../../../CUSTOMER"/></DATA></COL>

            <COL><DATA><xsl:value-of select="../../../../CUSTOMER_NUMBER"/></DATA></COL>

            <COL><DATA><xsl:value-of select="../../../../CUSTOMER_PO_NUMBER"/></DATA></COL>

            <COL><DATA><xsl:value-of select="../../../../ROUT_CLASS"/></DATA></COL>

            <COL><DATA><xsl:value-of select="../../../../ORG"/></DATA></COL>

            <COL><DATA><xsl:value-of select="../../../../BATCH_NUMBER"/></DATA></COL>

            <COL><DATA><xsl:value-of select="../../../../BATCH_ID"/></DATA></COL>

            <COL><DATA><xsl:value-of select="../../../../PARENT_BATCH_ID"/></DATA></COL>

            <COL><DATA><xsl:value-of select="../../../../SALES_ORDER_NUMBER"/></DATA></COL>

            <COL><DATA><xsl:value-of select="../../../../SALES_ORDER_LINE_NUMBER"/></DATA></COL>

            <COL><DATA><xsl:value-of select="../../../../SCHEDULE_SHIP_DATE"/></DATA></COL>

            <COL><DATA><xsl:value-of select='.'/></DATA></COL>

            <COL><DATA><xsl:value-of select="../../../../LIST_PRD_DTL/PRD_DTL/PROD_TYPE"/></DATA></COL>

            <COL><DATA><xsl:value-of select="../../../../LIST_PRD_DTL/PRD_DTL/PROD_QTY"/></DATA></COL>

            <COL><DATA><xsl:value-of select="../../../../LIST_PRD_DTL/PRD_DTL/PROD_UOM"/></DATA></COL>

            <COL><DATA><xsl:value-of select="../../../../LIST_PRD_DTL/PRD_DTL/PROD_BATCH_ID"/></DATA></COL>

            <COL><DATA><xsl:value-of select="../../../../LIST_PRD_DTL/PRD_DTL/PROD_ITEM_TYPE"/></DATA></COL>

            <COL><DATA><xsl:value-of select="../../../../LIST_PRD_DTL/PRD_DTL/MIX_DESIGNATOR"/></DATA></COL>

            <COL><DATA><xsl:value-of select="../../../../LIST_PRD_DTL/PRD_DTL/PLATE_DESIGNATOR"/></DATA></COL>

            <COL><DATA><xsl:value-of select="../../../../LIST_PRD_DTL/PRD_DTL/ORG_ROW/ROWLIST/ROWLI[$LOOP]"/></DATA></COL>

            <COL><DATA><xsl:value-of select="../../../../LIST_PRD_DTL/PRD_DTL/ORG_COL/COLLIST/COLLI[$LOOP]"/></DATA></COL>

            <COL><DATA><xsl:value-of select="../../../../LIST_PRD_DTL/PRD_DTL/SCALE"/></DATA></COL>

            <COL><DATA><xsl:value-of select="../../../../LIST_PRD_DTL/PRD_DTL/PURIFICATION"/></DATA></COL>

            <COL><DATA><xsl:value-of select="../../../../LIST_PRD_DTL/PRD_DTL/FIVE_MOD_CAT"/></DATA></COL>

            <COL><DATA><xsl:value-of select="../../../../LIST_PRD_DTL/PRD_DTL/THREE_MOD_CAT"/></DATA></COL>

            <COL><DATA><xsl:value-of select="../../../../LIST_PRD_DTL/PRD_DTL/OLIGO_FUNCTION"/></DATA></COL>

            <COL><DATA><xsl:value-of select="../../../../LIST_PRD_DTL/PRD_DTL/MAX_VOL"/></DATA></COL>

            <COL><DATA><xsl:value-of select="../../../../LIST_PRD_DTL/PRD_DTL/NOTES"/></DATA></COL>

            <COL><DATA><xsl:value-of select="../../../../LIST_PRD_DTL/PRD_DTL/SHIPPING_VESSEL"/></DATA></COL>

            <COL><DATA><xsl:value-of select="../../../../LIST_PRD_DTL/PRD_DTL/EXACT_NMOL"/></DATA></COL>

           </ROW>

         </xsl:if>

        </xsl:for-each>

      </RESULTSET>

Outcomes