Mapping with custom xsl

Home Page Forums BizTalk 2004 – BizTalk 2010 Mapping with custom xsl

Viewing 1 reply thread
  • Author
    Posts
    • #14976

      Im trying to transform a message through custom XSL inside BT mapper.
      The output message is empty.
      I have very simple case:
      This is the incoming xml:

      <ns0:Employees xmlns:ns0=\”http://CustomXSL.req\”>
      <Employee>
      <FName>Bill</FName>
      <LName>Clinton</LName>
      </Employee>
      </ns0:Employees>

      And this is the xsl transform:

      <?xml version=\”1.0\”?>
      <xsl:stylesheet version=\”1.0\”
      xmlns:xsl=\”http://www.w3.org/1999/XSL/Transform\”>
      <xsl:template match=\”/\”>
      <empoutput xmlns=\”http://CustomXSL.scmout\”>
      <xsl:for-each select=\”Employees/Employee\”>
      <FullName>
      <xsl:value-of select=\”FName\”/>
      <xsl:value-of select=\”LName\”/>
      </FullName>
      </xsl:for-each>
      </empoutput>
      </xsl:template>
      </xsl:stylesheet>

      the output is:
      <?xml version=\”1.0\” encoding=\”utf-8\”?><empoutput xmlns=\”http://CustomXSL.scmout\”></empoutput>
      instead of
      <?xml version=\”1.0\” encoding=\”utf-8\”?><empoutput xmlns=\”http://CustomXSL.scmout\”><FullName>BillClinton</FullName></empoutput>

      10x

    • #14975

      You need to specify the namespace of the source document:

      [code:1:c792559def]<?xml version=\"1.0\"?>
      <xsl:stylesheet version=\"1.0\"
      xmlns:xsl=\"http://www.w3.org/1999/XSL/Transform\"
      xmlns:s0=\"http://CustomXSL.req\"
      exclude-result-prefixes=\"s0\">
      <xsl:template match=\"/\">
      <empoutput xmlns=\"http://CustomXSL.scmout\">
      <xsl:for-each select=\"s0:Employees/Employee\">
      <FullName>
      <xsl:value-of select=\"FName\"/>
      <xsl:value-of select=\"LName\"/>
      </FullName>
      </xsl:for-each>
      </empoutput>
      </xsl:template>
      </xsl:stylesheet> [/code:1:c792559def]

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