3 Replies Latest reply: Dec 18, 2012 2:13 PM by 970002 RSS

    Using XSLT inside For Each Loop

    970002
      I have a file that i insert into a table. I use a for each to process each record. For each record I have a couple of assigns that do some calculations and some mappings. I would like to combine these into 1 XSLT because the process takes forever to process the file and I think i can combine these assigns into 1 XSLT. I currently reference the index number when assigned from the array in the assign process using below.

      $ReceiveFromFile_Read_InputVariable.body/ns3:ReadFileProductBookFileRecord[position()=bpws:getVariableData('I')]/ns3:C7


      How do I reference the index in the XSLT?
        • 1. Re: Using XSLT inside For Each Loop
          Albin
          Refer the below URL to find the details about passing the parameters to the XSLT and refer the same.

          http://www.albinsblog.com/2012/07/passing-parameter-to-xslt-in-soa-11g.html#.UM2OYKycaS0

          The index value can be passed to the XSLT from the BPEL process using the same the elements from the array can be referenced ( [position()=$indexvariable] ).


          I hope this will help you......


          Regards
          Albin I
          http://www.albinsblog.com
          • 2. Re: Using XSLT inside For Each Loop
            970002
            I'm testing this out. The ReadFileProductBookFileList is all of the records from an input file. I want to map to the index [1] of the top:F55F044Collection. I want to take the record of the input file, do some transformation and then store the current record in the Collenction as record 1. What is the syntax of the C1 record to get the current index record only.


            <source type="WSDL">
            <schema location="ReadFileProductBookFile.wsdl"/>
            <rootElement name="parameters" namespace="http://xx.com/XSLTParameters"/>
            <param name="parameters" />
            </source>


            <xsl:param name="parameters"/>
            <xsl:template match="/">
            <top:F55F044Collection>
            <top:F55F044>
            <top:q2Y57Ccur>
            <xsl:value-of select="/imp1:ReadFileProductBookFileList/imp1:ReadFileProductBookFileRecord/imp1:C1"/>
            </top:q2Y57Ccur>
            </top:F55F044>
            </top:F55F044Collection>
            </xsl:template>
            </xsl:stylesheet>
            • 3. Re: Using XSLT inside For Each Loop
              970002
              Any ideas out there?