Problems with mappings

Home Page Forums BizTalk 2004 – BizTalk 2010 Problems with mappings

Viewing 1 reply thread
  • Author
    Posts
    • #12660

      Hi, I’m new in biztalk and I need to solve this problem.

      I’m receiving messages like this

      [code:1:2024a571b6]<ns0:SCADA_MEDICION punto_medicion=\"punto_medicion_0\" />
      <ns0:cromatografia poder_calorifico=\"10.4\" densidad=\"10.4\" />
      </ns0:SCADA_MEDICION>[/code:1:2024a571b6]

      Then I need to transform them to this one

      [code:1:2024a571b6]<ns0:Medicion>
      <Header>
      <Punto_Medicion>Punto_Medicion_0</Punto_Medicion>
      </Header>
      <Tags>
      <Tag>
      <Description>poder_calorifico</Description>
      <Value>10.4</Value>
      </Tag>
      <Tag>
      <Description>densidad</Description>
      <Value>10.4</Value>
      </Tag>
      </Tags>
      </ns0:Medicion>[/code:1:2024a571b6]

      Can I resolve the problem using schemas and maps? or I need to write some code?

      Somebody can help me?

      Thanks in advance.

      Mauricio Bs. As – Argentina

    • #12661

      You can use an XSLT Template in a map like this:
      Connect <cromatografia> to a Scripting Functoid (Advanced) and connect output to <Tag>

      Within the functoid select [b:f8571d04b4]Inline XSLT Call Template[/b:f8571d04b4] and add the following xsl code

      [code:1:f8571d04b4]<xsl:template name=\"TagTemplate\">
      <xsl:param name=\"param1\" />
      <xsl:for-each select=\"$param1/@*\">
      <xsl:element name=\"Tag\">
      <xsl:element name=\"Description\">
      <xsl:value-of select=\"local-name()\" />
      </xsl:element>
      <xsl:element name=\"Value\">
      <xsl:value-of select=\".\" />
      </xsl:element>
      </xsl:element>
      </xsl:for-each>
      </xsl:template>[/code:1:f8571d04b4]

      I had a small problem with this on BTS2006 as my BTS2004 dev environment is undergoing maintenance currently.
      If this does not work can you post the XSL output from the map.

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