Mapping problem – XML to String

Home Page › Forums › BizTalk 2004 – BizTalk 2010 › Mapping problem – XML to String

Viewing 1 reply thread
  • Author
    Posts
    • #23899

      Hi,

       

      Can anyone give me an advice on the following problem.

      I want to map the following structure into one element of type string.

           <ns2:AdditionalData>
                    <ns2:Description>Description_1</ns2:Description>
                    <ns2:Value>Value_1</ns2:Value>
          </ns2:AdditionalData>
          <ns2:AdditionalData>
                    <ns2:Description>Description_2</ns2:Description>
                    <ns2:Value>Value_2</ns2:Value>
          </ns2:AdditionalData>
      … and moore

      String format:

      <Notes>”Description_1:Value_1\nDescription_2:value_2\n…….”</Notes>

      This structure can occur several times in the incoming message.

      I tried to map the node AdditionaData to a Scripting functoid but the input seems to be Null.

       

      Thanks, Dag

       

       

       

       

       

       

       

       

       

       

    • #23928

      You could try a scripting functoid with inline XSLT:

      <Notes>

      <xsl:for-each select=”AdditionalInfo”>

        <xsl:variable name=”var:v1″ select=”Description” /> 

        <xsl:variable name=”var:v2″ select=”Value” /> 

        <xsl:value-of select=”$var:v1″ /> 

        <xsl:value-of select=”$var:v2″ /> 

      </xsl:for-each>

      </Notes>

      • #23929

        Or

        <Notes>
        <xsl:for-each select=”AdditionalInfo”>
          <xsl:value-of select=”concat(Description, ‘:’, Value” />
          <xsl:if test=”position() != last()”>
               <xsl:text>\n</xsl:text>
          </xsl:if>
        </xsl:for-each>
        </Notes>

Viewing 1 reply thread
  • The forum ‘BizTalk 2004 – BizTalk 2010’ is closed to new topics and replies.