locked
Want to map particular portion of xml into single element in Biztalk mapper. RRS feed

  • Question

  • I want map particular portion of xml into single element in Biztalk mapper. I am using script funtoid for mapping particular portion of xml but it talkes all part of xml into PlanDet element. I am using following code inside the functoid. Please help me.

    <xsl:template name="xml-to-string-called-template">
       <xsl:param name="param1" />
              <xsl:element name="ns3:PlanDet">
                    <xsl:text disable-output-escaping="yes">&lt;![CDATA[</xsl:text>
                    <xsl:call-template name="identity" />
                    <xsl:text disable-output-escaping="yes">]]&gt;</xsl:text>
               </xsl:element>
    </xsl:template>
    <xsl:template name="identity" match="@*|node()">
       <xsl:copy>
    <xsl:apply-templates select="@*|node()" />
       </xsl:copy>
     </xsl:template>

    Monday, December 21, 2015 11:45 AM

Answers

  • Hi Arivazhagan,

    I think you can achieve this replacing 

    <xsl:template name="identity" match="@*|node()">
       <xsl:copy>
    <xsl:apply-templates select="@*|node()" />
       </xsl:copy>
     </xsl:template>

    to 

    <xsl:template name="identity" match="PlanDet">
       <xsl:copy-of select="PlanDet"/>
     </xsl:template>

    here is an example:

    Regards,

    Muhammad Kamal

    • Marked as answer by Arivazhagan K Tuesday, December 22, 2015 9:57 AM
    Monday, December 21, 2015 4:26 PM

All replies

  • What exactly is you desired output?  Can you give an example of PlanDet?

    I don't think you should be applying a wildcard copy in a wildcard template first of all.

    Monday, December 21, 2015 1:24 PM
    Moderator
  • I need to map all Plandet xml data into PlantDet Data element. 

    For example  these XML "<PlanDet><Character>test</Character><UOM>test</UOM><PlanDet> " needs to map with PlanDet Child field element to destination schema.

    Monday, December 21, 2015 1:48 PM
  • Do you mean you need all  PlanDets content included in PlanDet as a string?
    Monday, December 21, 2015 2:21 PM
    Moderator
  • Hi Arivazhagan,

    I think you can achieve this replacing 

    <xsl:template name="identity" match="@*|node()">
       <xsl:copy>
    <xsl:apply-templates select="@*|node()" />
       </xsl:copy>
     </xsl:template>

    to 

    <xsl:template name="identity" match="PlanDet">
       <xsl:copy-of select="PlanDet"/>
     </xsl:template>

    here is an example:

    Regards,

    Muhammad Kamal

    • Marked as answer by Arivazhagan K Tuesday, December 22, 2015 9:57 AM
    Monday, December 21, 2015 4:26 PM
  • Thank You Mohamad Kamal. It is working.
    Tuesday, December 22, 2015 9:57 AM