3 Replies Latest reply: Jul 5, 2012 10:31 PM by vladodias RSS

    append xml node into a list

    908036
      Hi,

      In an embedded sub process with looping logic, we have a db adapter call.
      We are trying to insert the single response object from each of the db adapter call into a list.

      Problem we are facing is the list is not able to append the new db response into the list.
      AppendToList is not of help. XSLT construct copy-to was not of help.

      Using the following three messages
      Msg1: - Loop Interation 1
      <elementCollection>
      <element>aaa</element>
      </elementCollection>
      Msg2: - Loop Interation 2
      <elementCollection>
      <element>bbb</element>
      </elementCollection>
      Msg3: - Loop Interation 3
      <elementCollection>
      <element>ccc</element>
      </elementCollection>

      to be inserted into the following message
      Result: - After all the iterations
      <elementCollection>
      <element>aaa</element>
      <element>bbb</element>
      <element>ccc</element>
      </elementCollection>

      Any help/pointers will be appreciated.


      Edited by: 905033 on Jul 4, 2012 10:32 PM
      provided sample messages

      Edited by: 905033 on Oct 23, 2012 2:55 AM
        • 1. Re: append xml node into a list
          vladodias
          Post an example of what input you have and what you need for output and I can help you with the XSLT transformation.

          https://forums.oracle.com/forums/ann.jspa?annID=893
          • 2. Re: append xml node into a list
            908036
            I have updated my question. Can you please help ?
            • 3. Re: append xml node into a list
              vladodias
              Please see the transformation bellow... I've built a quick sample and it worked for me.

              Cheers,
              Vlad

              It is considered good etiquette to reward answerers with points (as "helpful" - 5 pts - or "correct" - 10pts).
              https://forums.oracle.com/forums/ann.jspa?annID=893
              <xsl:stylesheet version="1.0"
              ...
              ...
                <xsl:param name="Variable_2"/>
                <xsl:param name="Variable_3"/>
                <xsl:template match="/">
                  <ns0:elementCollection>
                    <xsl:for-each select="ns0:elementCollection/ns0:element">
                      <ns0:element>
                        <xsl:value-of select="."/>
                      </ns0:element>
                    </xsl:for-each>
                    <xsl:for-each select="$Variable_2/ns0:elementCollection/ns0:element">
                      <ns0:element>
                        <xsl:value-of select="."/>
                      </ns0:element>
                    </xsl:for-each>
                    <xsl:for-each select="$Variable_3/ns0:elementCollection/ns0:element">
                      <ns0:element>
                        <xsl:value-of select="."/>
                      </ns0:element>
                    </xsl:for-each>
                  </ns0:elementCollection>
                </xsl:template>
              </xsl:stylesheet>