BizTalk Map selection

Hi,
I am trying to understand how Map selection happens under the hood in the
BizTalk engine.
Say i have 3 message types, X , Y and Z.
I have 2 maps:
X to Y
X to Z.
so the source message type is the same for the maps.
In the Receive port, i define both the maps.
How does BizTalk engine determine which map to apply?
Is there any way to influence map selection i.e under certain context properties or message data, choose the first map otherwise second.
Please let me know.
Regards,
MS

Hi MS,
#1 Yes we can
have maps with same source without any error as multiple maps are supported on port,
but only one of them will be executed and its unpredictable which one will be the chosen one.
#2 Yes, you can achieve this using dynamic
mapping resolver. 
Now what is Dynamic Mapping Resolver?
It is a mechanism of dynamically(at run time) associate map name from existing repository like business
rule engine or custom configuration database table to transformer based on an identifier contained in each source instance message.
Dynamic map resolver can applied at:
1) Inbound maps
2) outbound maps
3) Orchestration.
For detailed explanation and working of dynamic map resolver refer: BizTalk
Server: Dynamic Mapping Resolver
Rachit 
Please mark as answer or vote as helpful if my reply does

Similar Messages

  • Biztalk Map Logic

    Hi,
    I have the Biztalk Map logic as shown in figure
    Discount Step and Loyalty both are repeatitive node structures
    Sample Input Xml is as shown below
    <DiscountStepList>
     <DiscountStep>
      <NumberOfTrips>35</NumberOfTrips>
      <Percentage>1113</Percentage>
      </DiscountStep>
     <DiscountStep>
      <NumberOfTrips>5</NumberOfTrips>
      <Percentage>7732</Percentage>
      </DiscountStep>
     <DiscountStep>
      <NumberOfTrips>30</NumberOfTrips>
      <Percentage>8280</Percentage>
      </DiscountStep>
       </DiscountStepList>
    the logic to get the o/p will be
    For Childe Element MIntrip:
    in the first iteration Mintrip=1 and in Secoond iteration Mintrip=Last elememnt Maxtrips+1
    For CHild Element Maxtrips:
    In the first Iteration Maxtrips="NumberOfTrips" and in Second iteration current element MintripNum  + NumberOfTrips.
    The o/p for the above input example will be like
    <ns0:Loyalites xmlns:ns0="http://BizTalk_Server_Project7.Schemdfa1">
      <Loaylty>
        <MinTrip>1</MinTrip>
        <MaxTrips>35</MaxTrips>
      </Loaylty>
    <Loaylty>
        <MinTrip>36</MinTrip>
        <MaxTrips>41(36+5)</MaxTrips>
      </Loaylty>
    <Loaylty>
        <MinTrip>36</MinTrip>
        <MaxTrips>41(36+5)</MaxTrips>
      </Loaylty>
    <Loaylty>
        <MinTrip>42</MinTrip>
        <MaxTrips>72(42+30)</MaxTrips>
      </Loaylty>
    </ns0:Loyalites>
    Is it possible in Biztalk Map using functoids?

    Sujith,
    You got to buy me a drink :)
    You can achive this using XSLT in your map, following XSLT will get the desired result:
    <?xml version="1.0" encoding="UTF-16"?>
    <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:msxsl="urn:schemas-microsoft-com:xslt" xmlns:var="http://schemas.microsoft.com/BizTalk/2003/var" exclude-result-prefixes="msxsl var" version="1.0" xmlns:ns0="http://BizTalk_Server_Project7.Schemdfa1" >
    <xsl:output omit-xml-declaration="yes" method="xml" version="1.0" />
    <xsl:template match="/">
    <xsl:apply-templates select="/DiscountStepList" />
    </xsl:template>
    <xsl:template match="/DiscountStepList">
    <ns0:Loyalites>
    <xsl:for-each select="DiscountStep">
    <xsl:if test="position() =1">
    <Loaylty>
    <MinTrip>
    <xsl:value-of select="position()" />
    </MinTrip>
    <MaxTrips>
    <xsl:value-of select="NumberOfTrips/text()" />
    </MaxTrips>
    </Loaylty>
    <xsl:call-template name="ConstructNextLoayltyNode">
    <xsl:with-param name="i" select="2"/>
    <xsl:with-param name="limit" select="count(/DiscountStepList/DiscountStep)"/>
    <xsl:with-param name="vMaxTrips" select="NumberOfTrips/text()"/>
    </xsl:call-template>
    </xsl:if>
    </xsl:for-each>
    </ns0:Loyalites>
    </xsl:template>
    <xsl:template name="ConstructNextLoayltyNode">
    <xsl:param name="i"/>
    <xsl:param name="limit"/>
    <xsl:param name="vMaxTrips"/>
    <xsl:if test="$i &lt;= $limit">
    <Loaylty>
    <MinTrip>
    <xsl:value-of select="$vMaxTrips + 1" />
    </MinTrip>
    <MaxTrips>
    <xsl:value-of select="$vMaxTrips + 1 +/DiscountStepList/DiscountStep[$i]/NumberOfTrips/text() " />
    </MaxTrips>
    </Loaylty>
    <xsl:call-template name="ConstructNextLoayltyNode">
    <xsl:with-param name="i" select="$i+1"/>
    <xsl:with-param name="limit" select="$limit"/>
    <xsl:with-param name="vMaxTrips" select="$vMaxTrips + 1 +/DiscountStepList/DiscountStep[$i]/NumberOfTrips/text()"/>
    </xsl:call-template>
    </xsl:if>
    </xsl:template>
    </xsl:stylesheet>
    Note: You may have to change the namespace as yours. And also the output sample you have show has repeated node as following which is correct.
    <Loaylty>
        <MinTrip>36</MinTrip>
        <MaxTrips>41(36+5)</MaxTrips>
      </Loaylty>
    <Loaylty>
        <MinTrip>36</MinTrip>
        <MaxTrips>41(36+5)</MaxTrips>
      </Loaylty>
    For your requirement you will get the out as following which your requirement:
    <ns0:Loyalites xmlns:ns0="http://BizTalk_Server_Project7.Schemdfa1">
    <Loaylty>
    <MinTrip>1</MinTrip>
    <MaxTrips>35</MaxTrips>
    </Loaylty>
    <Loaylty>
    <MinTrip>36</MinTrip>
    <MaxTrips>41</MaxTrips>
    </Loaylty>
    <Loaylty>
    <MinTrip>42</MinTrip>
    <MaxTrips>72</MaxTrips>
    </Loaylty>
    </ns0:Loyalites>
    Regards,
    M.R.Ashwin Prabhu
    If this answers your question please mark it accordingly. If this post is helpful, please vote as helpful by clicking the upward arrow mark next to my reply.

  • When I try and Save for Web in Photoshop CC I receive an error message saying 'The operation cannot be completed. The requested operation cannot be perfomed on a file with a user-mapped selection open'.

    When I try and Save for Web in Photoshop CC I receive an error message saying 'The operation cannot be completed. The requested operation cannot be performed on a file with a user-mapped selection open'. This happens with any of my files not just one in particular...
    Can anyone help solve this please?

    ELEMENTS 12 AND ELEMENTS 13
    Upgraded to 13 Thinking might resolve the issue.
    Was working fine up until we had "Tech" come in the office and "up grade some stuff"
    then all of a sudden i started getting this message, something happened but i don't have a clue what.

  • BizTalk Map: Grouping CRM Response XML based on the ID field in Custom XSLT

    Hi,
    I will receive a CRM response as below. 
    <ns0:RetrieveMultipleResponse xmlns:ns0="http://schemas.microsoft.com/xrm/2011/Contracts/Services" xmlns:ns2="http://schemas.microsoft.com/2003/10/Serialization/Arrays" xmlns:ns3="http://schemas.microsoft.com/xrm/2011/Metadata" xmlns:ns5="http://schemas.microsoft.com/2003/10/Serialization/" xmlns:ns1="http://schemas.datacontract.org/2004/07/System.Collections.Generic" xmlns:ns4="http://schemas.microsoft.com/xrm/2011/Contracts"><ns0:RetrieveMultipleResult>    <ns4:Entities>      <ns4:Entity>        <b:Attributes xmlns:b="http://schemas.microsoft.com/xrm/2011/Contracts" xmlns="http://schemas.microsoft.com/xrm/2011/Contracts/Services" xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns:c="http://schemas.datacontract.org/2004/07/System.Collections.Generic">            <b:KeyValuePairOfstringanyType>            <c:key>ccx_datevaccineinfostatementpresented</c:key>            <c:value i:type="d:dateTime" xmlns:d="http://www.w3.org/2001/XMLSchema">2012-08-14T04:00:00Z</c:value>          </b:KeyValuePairOfstringanyType>          <b:KeyValuePairOfstringanyType>            <c:key>ccx_administeredamount</c:key>            <c:value i:type="d:decimal" xmlns:d="http://www.w3.org/2001/XMLSchema">0.75000000</c:value>          </b:KeyValuePairOfstringanyType>          <b:KeyValuePairOfstringanyType>            <c:key>ccx_immunizationid</c:key>            <c:value i:type="d:guid" xmlns:d="http://schemas.microsoft.com/2003/10/Serialization/">826c2b0e-a349-e411-866c-00155d1e1f77</c:value>          </b:KeyValuePairOfstringanyType>     </b:Attributes>  </ns4:Entity>   <ns4:Entity>        <b:Attributes xmlns:b="http://schemas.microsoft.com/xrm/2011/Contracts" xmlns="http://schemas.microsoft.com/xrm/2011/Contracts/Services" xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns:c="http://schemas.datacontract.org/2004/07/System.Collections.Generic">            <b:KeyValuePairOfstringanyType>            <c:key>ccx_datevaccineinfostatementpresented</c:key>            <c:value i:type="d:dateTime" xmlns:d="http://www.w3.org/2001/XMLSchema">2012-08-14T04:00:00Z</c:value>          </b:KeyValuePairOfstringanyType>          <b:KeyValuePairOfstringanyType>            <c:key>ccx_administeredamount</c:key>            <c:value i:type="d:decimal" xmlns:d="http://www.w3.org/2001/XMLSchema">0.25000</c:value>          </b:KeyValuePairOfstringanyType>          <b:KeyValuePairOfstringanyType>            <c:key>ccx_immunizationid</c:key>            <c:value i:type="d:guid" xmlns:d="http://schemas.microsoft.com/2003/10/Serialization/">766c2b0e-a349-e411-866c-00155d1e1f77</c:value>          </b:KeyValuePairOfstringanyType>     </b:Attributes>  </ns4:Entity><ns4:Entity>        <b:Attributes xmlns:b="http://schemas.microsoft.com/xrm/2011/Contracts" xmlns="http://schemas.microsoft.com/xrm/2011/Contracts/Services" xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns:c="http://schemas.datacontract.org/2004/07/System.Collections.Generic">            <b:KeyValuePairOfstringanyType>            <c:key>ccx_datevaccineinfostatementpresented</c:key>            <c:value i:type="d:dateTime" xmlns:d="http://www.w3.org/2001/XMLSchema">2012-08-14T04:00:00Z</c:value>          </b:KeyValuePairOfstringanyType>          <b:KeyValuePairOfstringanyType>            <c:key>ccx_administeredamount</c:key>            <c:value i:type="d:decimal" xmlns:d="http://www.w3.org/2001/XMLSchema">0.7500000000</c:value>          </b:KeyValuePairOfstringanyType>          <b:KeyValuePairOfstringanyType>            <c:key>ccx_immunizationid</c:key>            <c:value i:type="d:guid" xmlns:d="http://schemas.microsoft.com/2003/10/Serialization/">826c2b0e-a349-e411-866c-00155d1e1f77</c:value>          </b:KeyValuePairOfstringanyType>     </b:Attributes>  </ns4:Entity></Entities></ns0:RetrieveMultipleResult></ns0:RetrieveMultipleResponse>
    I have  to count the distinct Entities based on ccx_immunizationid value & also I have to group the fields if both entity has same immunization ID. If the xml file (without namespace) and the field is <ccx_immunizationid>2323</ccx_imunizationid>,
    I can use something like below,
    <xsl:template match="//Entity/Attributes[not(./ccx_immunizationid= preceding::ccx_immunizationid)]">
    but here, I have to look for the key 'ccx_immunizationid' and its value. 
    I am using custom xslt in BizTalk map. Please help. Thanks.
    Regards,
    Lakshmi

    You need to get the distinct record filtered by "value" field whose "key" is "ccx_immunizationid" i.e <c:key>ccx_immunizationid</c:key>".
    So you need to use the XPath with syntax: 
    /*[not(@name = preceding::*/@name)]
    So in your case, the XPath value will be like the following:
    /*[local-name()='RetrieveMultipleResponse' and namespace-uri()='http://schemas.microsoft.com/xrm/2011/Contracts/Services']/*[local-name()='RetrieveMultipleResult' and namespace-uri()='http://schemas.microsoft.com/xrm/2011/Contracts/Services']/*[local-name()='Entities' and namespace-uri()='http://schemas.microsoft.com/xrm/2011/Contracts']/*[local-name()='Entity' and namespace-uri()='http://schemas.microsoft.com/xrm/2011/Contracts']/*[local-name()='Attributes' and namespace-uri()='http://schemas.microsoft.com/xrm/2011/Contracts']/*[local-name()='KeyValuePairOfstringanyType' and namespace-uri()='http://schemas.microsoft.com/xrm/2011/Contracts'][*[local-name()='key' and namespace-uri()='http://schemas.datacontract.org/2004/07/System.Collections.Generic']/text() ='ccx_immunizationid'][not(*[local-name()='value' and namespace-uri()='http://schemas.datacontract.org/2004/07/System.Collections.Generic'] = preceding::*[local-name()='value' and namespace-uri()='http://schemas.datacontract.org/2004/07/System.Collections.Generic'])]
    You may need to change the namespaces according to yours. This XPath would give you an idea of how to use the distinct XPath (1.0) snystax as shown above in your XML.
    If this answers your question please mark it accordingly. If this post is helpful, please vote as helpful by clicking the upward arrow mark next to my reply.

  • BizTalk map Julian date

    Hi,
    how can i convert date into julian date in BT map. 
    Thanks in adv.
    2Venture2

    Try this in BizTalk map via an inline C# scripting functoid
    public static string ToJulian(string strdateTime)
    DateTime dateTime = Convert.ToDateTime(strdateTime);
    int day = dateTime.Day;
    int month = dateTime.Month;
    int year = dateTime.Year;
    if (month < 3)
    month = month + 12;
    year = year - 1;
    long dt = day + (153 * month - 457) / 5 + 365 * year + (year / 4) - (year / 100) + (year / 400) + 1721119;
    return dt.ToSTring(dt);
    or this returns long, and the input parameter is datetime
    public static long ToJulian(DateTime dateTime)
    int day = dateTime.Day;
    int month = dateTime.Month;
    int year = dateTime.Year;
    if (month < 3)
    month = month + 12;
    year = year - 1;
    return day + (153 * month - 457) / 5 + 365 * year + (year / 4) - (year / 100) + (year / 400) + 1721119;
    Refer this article for more details:http://mikearnett.wordpress.com/2011/09/13/c-convert-julian-date/
    Following in the what we have been using in our maps, this has two static methods. One for standard datetime to Julian and another to convert Short datetime to Julian:
    public int ToJulian(string dt)
    try
    DateTime date = DateTime.Parse(dt);
    return ((date.Year - 1900) * 1000) + date.DayOfYear;
    catch
    return 0;
    /// <summary>
    /// Convert to Julian from dd/mm/yy
    /// </summary>
    /// <param name="dt"></param>
    /// <returns></returns>
    public int ToJulianFromShortDT(string dt)
    try
    DateTime date = new DateTime(int.Parse(dt.Substring(6, 2))+2000, int.Parse(dt.Substring(3, 2)), int.Parse(dt.Substring(0, 2)));;
    return ((date.Year - 1900) * 1000) + date.DayOfYear;
    catch
    return 0;
    If this answers your question please mark it accordingly. If this post is helpful, please vote as helpful by clicking the upward arrow mark next to my reply.

  • Biztalk Map: Repeated node

    Hi,
    Please find below Input file
    <Vin_Decoder>
    <Process>
    <Risk>
    <Line>
    <Exposer>
    <Type>VIN</type>
    <Svalue>123456789123456789</Svalue>
    </Exposer>
    <Exposer>
    <Type>Year</type>
    <Svalue>2014</Svalue>
    </Exposer>
    <Exposer>
    <Type>MAKE</type>
    <Svalue>2546</Svalue>
    </Exposer>
    <Exposer>
    <Type>Discripttion</type>
    <Svalue></Svalue>
    </Exposer>
    </line>
    </risk>
    <Risk>
    <Line>
    <Exposer>
    <Type>VIN</type>
    <Svalue>123456789987654321</Svalue>
    </Exposer>
    <Exposer>
    <Type>Year</type>
    <Svalue>2013</Svalue>
    </Exposer>
    <Exposer>
    <Type>MAKE</type>
    <Svalue>6789</Svalue>
    </Exposer>
    <Exposer>
    <Type>Discripttion</type>
    <Svalue>kfjdklf</Svalue>
    </Exposer>
    </line>
    </risk>
    </Process>
    </Vin_Decoder>
    and i am expecting the out put format
    <Vin_Decoder>
    <Decoder>
    <VIN>123456789123456789</VIN>
    <Year>2014</Year>
    <Make>2546</Make>
    <Description></Description>
    </Decoder>
    <Decoder>
    <VIN>123456789987654321</VIN>
    <Year>2013</Year>
    <Make>7896</Make>
    <Description>kfjdklf</Description>
    </Decoder>
    </Vin_Decoder>
    please suggest me how to do this in biztalk map..
    Thanks..

    Hi,
    In the Vin_Decoder schema create a "Decoder" Child Record and make it optional. Inside the Decoder" Record create the all the Field Elements like VIN, Year, etc. Create a map where the source and destination is the Vin_Decoder schema. Map to the field
    elements inside the Decoder" Record.
    Kind regards,
    Tomasso Groenendijk
    Blog 
    |  Twitter
    MCTS BizTalk Server 2006, 2010
    If this answers your question please mark it accordingly

  • Invoice PO issue in BizTalk Map

    Hi All,
    I did get below error while I was testing the map. I have reloading the map so many times still I'm getting below error
    Invoking component...
    C:\somepath.btm: error btm1023: Exception Caught: The map contains a reference to a schema node that is not valid.  Perhaps the schema has changed.  Try reloading the map in the BizTalk Mapper.  The XSD XPath of the node is: /*[local-name()='<Schema>']/*[local-name()='']/*[local-name()='']/*[local-name()='INVOICE']/*[local-name()='POSITEID']
    Component invocation succeeded.
    How can i fix this error could you please assist me on this.
    Thanks & Regards,
    Vasu

    Hi Vasu,
    1) Try "CLEAN SOLUTION" and then try,
    2) If that doesnt fix. Choose the properties of the map and disable the “Ignore Namespaces for Links” like this:
    Refer: Two nodes on same
    level with same name but different namespace
    3) If that doesn't fix the issue, Refer this link. FIX:
    Error message when you validate a BizTalk map in BizTalk Server 2006 R2 or in BizTalk Server 2009 if the map and its schemas are in a separate project
    Rachit
    Please mark as answer or vote as helpful if my reply does

  • Create multiple line item from one line item in BizTalk mapping

    Hi,
    In one of our new requirement we need to create 3 line items for every line item we are receiving with same value but in the below format.
    Sample Input:
    <EmpId>1234</EmpId><Name>ABCD></Name><Dept>YYY</Dept><Year>2014</Year><Desc1>D1</Desc1><Desc2>D2</Desc2><Desc3>D3</Desc3><Valid>Yes</Valid>
    Sample Output in Flatfile:
    1234,ABCD,,,D1,Yes
    1234,ABCD,YYY,,D2,Yes
    1234,ABCD,YYY,2014,D3,Yes
    Can you Pls help me in creating the mapping in above format.
    Thanks in advance,
    Regards,
    Elango
    Chennai.
    Mark As Answer or Vote As Helpful if My Reply Does.

    Elango,
    Before I explain about the solution, make sure when you give inputs/requirement in forums for us to help you, pay attention.
    The input instance you have shown
    Doesn’t have a root element
    Has a typo - <Name>ABCD></Name> -Element has invalid “>” character.
    This makes us to spend more time in cleansing your input and then find out solution.
    We are here to help you, so help us to help you better.
    Anyway, coming to the solution
    You have to create map with a structure similar to the below shown image:
    Here destination schema is a flat file schema with comma-delimited fields.
    If you look into the destination schema, it look similar to your input schema, but there is just one “Desc” field instead of “Desc1”, “Desc2”, “Desc3” in your source schema. In destination, the
    record has to repeat with same values for rest of the fields. And for “Desc” in destination schema will have corresponding index value of “Desc1” or “Desc2” or “Desc3” from source. i.e. first node of destination will have value of “Desc1” from source to “Desc”
    field in destination, second node of destination will have value of “Desc2” from source to “Desc” field in destination and third node of destination will have value of “Desc3” from source to “Desc” field in destination.
    I use XSLT in the map, with recursive template which will repeat for 3 times. I have given comment in the XSLT for your benefit.
    <?xml version="1.0" encoding="UTF-16"?>
    <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:msxsl="urn:schemas-microsoft-com:xslt" xmlns:var="http://schemas.microsoft.com/BizTalk/2003/var" exclude-result-prefixes="msxsl var" version="1.0">
    <xsl:output omit-xml-declaration="yes" method="xml" version="1.0" />
    <xsl:template match="/">
    <xsl:apply-templates select="/Root" />
    </xsl:template>
    <xsl:template match="/Root">
    <Record>
    <!--Call the template with index and counter of 3. There times as you wanted for every item-->
    <xsl:call-template name="LintItemTemp">
    <xsl:with-param name="i">1</xsl:with-param>
    <xsl:with-param name="count">3</xsl:with-param>
    </xsl:call-template>
    </Record>
    </xsl:template>
    <xsl:template name="LintItemTemp">
    <xsl:param name="i" />
    <xsl:param name="count" />
    <Details>
    <EmpId>
    <xsl:value-of select="EmpId/text()" />
    </EmpId>
    <Name>
    <xsl:value-of select="Name/text()" />
    </Name>
    <Dept>
    <xsl:value-of select="Dept/text()" />
    </Dept>
    <Year>
    <xsl:value-of select="Year/text()" />
    </Year>
    <!--as in your output instance, Lineitem1 will have value of Desc1-->
    <xsl:if test ="($i =1)">
    <Desc>
    <xsl:value-of select="Desc1/text()" />
    </Desc>
    </xsl:if>
    <!--as in your output instance, Lineitem2 will have value of Desc3-->
    <xsl:if test ="($i =2)">
    <Desc>
    <xsl:value-of select="Desc2/text()" />
    </Desc>
    </xsl:if>
    <!--as in your output instance, Lineitem3 will have value of Desc3-->
    <xsl:if test ="($i =3)">
    <Desc>
    <xsl:value-of select="Desc3/text()" />
    </Desc>
    </xsl:if>
    <Valid>
    <xsl:value-of select="Valid/text()" />
    </Valid>
    <xsl:value-of select="./text()" />
    </Details>
    <!--Recursive template, i.e. calling the template again for 3 times as your requirement-->
    <xsl:if test="$i &lt; $count">
    <xsl:call-template name="LintItemTemp">
    <xsl:with-param name="i">
    <xsl:value-of select="$i + 1"/>
    </xsl:with-param>
    <xsl:with-param name="count">
    <xsl:value-of select="$count"/>
    </xsl:with-param>
    </xsl:call-template>
    </xsl:if>
    </xsl:template>
    </xsl:stylesheet>
    So the input and output will look like the below:
    You can change the schema/XSLT and its corresponding namespaces as you want.
    When the above shown output is send to a custom-pipeline with flat file assembler in send port will output the above shown output to the flat-file structure as you wanted. Again, I repeat you
    to use flat-file file schema with comma-delimited fields as the destination schema in the above shown map for you to get the flat-file output as you needed.
    If this answers your question please mark it accordingly. If this post is helpful, please vote as helpful by clicking the upward arrow mark next to my reply.

  • Biztalk Map create duplicate target node

    Using biztalk mapper, I need a target node to be duplicated.. I have created a simplified version of my issue. Please see below map
    link for source and destination schema.
    I  need the target Option node to be duplicated for each OptionNotes. The value of OptionNotes is to be split by a pipe ("|"),
    then map to target Code and Description.
    The input is as below:
    <ns0:Source xmlns:ns0="http://Test.SOAP.Source1">
    <Option>
    <OptionID>ID0_NoNotes</OptionID>
    <OptionName>OptionName_0</OptionName>
    </Option>
    <Option>
    <OptionID>ID1_NoNotes</OptionID>
    <OptionName>OptionName_1</OptionName>
    <OptionNotes>NOTE1|BLAH1</OptionNotes>
    <OptionNotes>NOTE2|BLAH2</OptionNotes>
    </Option>
    </ns0:Source>
    The output should be as below:
    <Destination>
    <Options>
    <Option>
    <Code>ID0_NoNotes</Code>
    <Description>OptionName_0</Description>
    </Option>
    <Option>
    <Code>ID1_NoNotes</Code>
    <Description>OptionName_1</Description>
    </Option>
    <Option>
    <Code>NOTE1</Code>
    <Description>BLAH1</Description>
    </Option>
    <Option>
    <Code>NOTE2</Code>
    <Description>BLAH2</Description>
    </Option>
    </Options>
    </Destination>
    Tried to use Looping and combination with Value Mapping, but to no avail. Do I have to resort to inline xslt?
    Thanks.

    Thanks for all your answers.
    @Pi_xel_xar Your suggestion requires a change in the message schema.
    @Nadeem We have already tried the solution on the blog, but it's not quite the scenario we face. The issue is the OptionNote is in the same layer as OptionID and OptionName.
    We have used another tool, which has done this easily. We then get the XSLT and import it as part of Inline XSLT scripting functoid.
    The XSLT produced was as below:
    <xsl:for-each select="ns0:Source/Option">
    <Option>
    <xsl:for-each select="OptionID">
    <Code>
    <xsl:value-of select="string(.)"/>
    </Code>
    </xsl:for-each>
    <xsl:for-each select="OptionName">
    <Description>
    <xsl:value-of select="string(.)"/>
    </Description>
    </xsl:for-each>
    </Option>
    </xsl:for-each>
    <xsl:for-each select="ns0:Source/Option/OptionNotes">
    <xsl:variable name="var1_resultof_cast" select="string(.)"/>
    <Option>
    <Code>
    <xsl:value-of select="substring-before($var1_resultof_cast, '|')"/>
    </Code>
    <Description>
    <xsl:value-of select="substring-after($var1_resultof_cast, '|')"/>
    </Description>
    </Option>
    </xsl:for-each>
    Thanks everyone.

  • BizTalk mapping for repeating Nodes using XSLT

    Hi,
    I am mapping the source schema to destination schema using Custom XSLT file. I have a repeating node in the Sources schema:
    Period node can repeat any number of times. I am using the XPath in XSLT to map the nodes from source to destination and using the "for-each" loop.
    Destination Schema:
    I want to map "PeriodID" and "Volume" both to the destination node "html:TD". I am using the following XSLT code:
    <xsl:for-each select="/*[local-name()='RootNode' and namespace-uri()='Namespace']/*[local-name()='Periods' and namespace-uri()='Namespace']/*[local-name()='Period' and namespace-uri()='Namespace']">
    <html:TR class="data0" level="0">
    <html:TD class="data-int" datatype="int">
    <xsl:value-of select="./*[local-name()='RootNode' and namespace-uri()='Namespace']/*[local-name()='Periods' and namespace-uri()='Namespace']/*[local-name()='Period' and namespace-uri()='Namespace']/*[local-name()='PeriodID' and namespace-uri()='Namespace']"/>
    </html:TD>
    <html:TD class="data-dbl" datatype="dbl">
    <xsl:value-of select="./*[local-name()='RootNode' and namespace-uri()='Namespace']/*[local-name()='Periods' and namespace-uri()='Namespace']/*[local-name()='Period' and namespace-uri()='Namespace']/*[local-name()='Volume' and namespace-uri()='Namespace']"/>
    </html:TD>
    </html:TR>
    </xsl:for-each>
    I am only getting the first value of both the nodes in every loop.
    I know that we can use the XPath of the actual Node(PeriodID) in "for-each" loop and use value-of="." to get the current values of the node.
    But the problem is I want both the values "PeriodID" and "Volume" repeating in the destination.

    if you use xpath like you did ( imean without index), you will only get 1 record elements each time.
    Either you have to use code like i did, or use index based xpath.
    The code i gave you should work, just try to debug it from visual studio. Because xslt is a case sensitive, check if the code i gave you matches the elements in case sensitive. may be you have to use prefixes like s1, s2 etc as per you xsl file declaration.
    Check you xsl file for prefix declarations.
    you can also try below code, it uses postion() method to get the current for loop index.
    <xsl:for-each select="/*[local-name()='RootNode' and namespace-uri()='Namespace']/*[local-name()='Periods' and namespace-uri()='Namespace']/*[local-name()='Period' and namespace-uri()='Namespace']">
    <html:TR class="data0" level="0">
    <html:TD class="data-int" datatype="int">
    <xsl:value-of select="(./*[local-name()='RootNode' and namespace-uri()='Namespace']/*[local-name()='Periods' and namespace-uri()='Namespace']/*[local-name()='Period' and namespace-uri()='Namespace']/*[local-name()='PeriodID' and namespace-uri()='Namespace'])[position()]"/>
    </html:TD>
    <html:TD class="data-dbl" datatype="dbl">
    <xsl:value-of select="(./*[local-name()='RootNode' and namespace-uri()='Namespace']/*[local-name()='Periods' and namespace-uri()='Namespace']/*[local-name()='Period' and namespace-uri()='Namespace']/*[local-name()='Volume' and namespace-uri()='Namespace'])[position()]"/>
    </html:TD>
    </html:TR>
    </xsl:for-each>
    but i insist you to verify for any prefix declarations in you xsl file
    Please mark the post as answer if this answers your question. If this post is helpful, please vote as helpful by clicking the upward arrow mark next to my reply.

  • How to map single to multiple record in Biztalk Map

    Hi,
    I have a flat file Input as below
    For understandability I am making it as XML:
    <Input>
    <Name>vignesh</Name>
    <Country>India</Country>
    <orderNumber>123<orderNumber>
    </Input>
    I am having a look up table to retrieve multiple LineItem per Name
    Output expected 
    I need to repeat the record based on the table as
    <Output>
    <Detail>
    <Name>vignesh</Name>
    <LineItems>38</LineItems>
    </Detail>
    <Detail>
    <Name>vignesh</Name>
    <LineItems>45</LineItems>
    </Detail>
    <Detail>
    <Name>vignesh</Name>
    <LineItems>88</LineItems>
    </Detail>
    <Detail>
    <Name>vignesh</Name>
    <LineItems>99</LineItems>
    </Detail>
    <Detail>
    <Name>vignesh</Name>
    <LineItems>85</LineItems>
    </Detail>
    </Output>
    I have created an external assembly to pull the data from database and concatenating the lineitems in a string as (38,45,88,99,85). Now either I need to use map functoids/inline xslt's.
    Please help to move further with some samples.
    Regards, Vignesh S

    Hi Vignesh,
    Add a scripting functiod as shown here in the image, in the scripting functiod call "Inline XSLT Call Template". This scripting functiod would have two parameters.
    1- Name link from the soruce schema. 2- Output something like "38,45,88,99,85" (without quotes). This could be link from the functiod which pulls the data from db. In my case, I just used a string fuctiod which would output
    38,45,88,99,85 to the scripting functiod.
    In the scripting fuctiod, use the below XSLT template. I have commented the XSLT to detail how it works:
    <xsl:template name="ConstructDetailNodeTemplate">
    <xsl:param name="name" />
    <xsl:param name="value" />
    <xsl:variable name="NameFromSoruce" select="$name"></xsl:variable>
    <!-- call splitter template which accepts the "," separated string -->
    <xsl:call-template name="StringSplit">
    <xsl:with-param name="nam" select="$NameFromSoruce" />
    <xsl:with-param name="val" select="$value" />
    </xsl:call-template>
    </xsl:template>
    <xsl:template name="StringSplit">
    <xsl:param name="nam" />
    <xsl:param name="val" />
    <!-- do a check to see if the input string (still) has a "," in it -->
    <xsl:choose>
    <xsl:when test="contains($val, ',')">
    <Detail>
    <Name>
    <xsl:value-of select="$nam"/>
    </Name>
    <!-- pull out the value of the string before the "," delimiter -->
    <LineItems><xsl:value-of select="substring-before($val, ',')" /></LineItems>
    </Detail>
    <!-- recursively call this template and pass in
    value AFTER the "," delimiter -->
    <xsl:call-template name="StringSplit">
    <xsl:with-param name="nam" select="$nam" />
    <xsl:with-param name="val" select="substring-after($val, ',')" />
    </xsl:call-template>
    </xsl:when>
    <xsl:otherwise>
    <!-- if there is no more delimiter values, print out
    the whole string -->
    <Detail>
    <Name>
    <xsl:value-of select="$nam" />
    </Name>
    <LineItems>
    <xsl:value-of select="$val" />
    </LineItems>
    </Detail>
    </xsl:otherwise>
    </xsl:choose>
    </xsl:template>
    The output would look like this as you wanted for the above your input:
    If this answers your question please mark it accordingly. If this post is helpful, please vote as helpful.

  • BizTalk Map - Xslt Issue

    Hi,
    Here is a piece of xslt, i need to replace the characters with their shortcode which are not supported in xml.
    For eg i need to replace '&' to '&amp' and similarly all other characters as mentioned
    Unsupported characters and their replacements:
    & - &amp;
    < - &lt;
    > - &gt;
    " - &quot;
    ' - &#39;
    XSLT:
    <xsl:if test="/*[local-name()='Root' and namespace-uri()='http://schemas.microsoft.com/BizTalk/2003/aggschema']/*[local-name()='InputMessagePart_1' and namespace-uri()='']/*[local-name()='GetOrderDetailsByIdResponse' and namespace-uri()='http://tempuri.org/']/*[local-name()='GetOrderDetailsByIdResult'
    and namespace-uri()='http://tempuri.org/']/*[local-name()='TermsAndConditionList' and namespace-uri()='http://schemas.datacontract.org/2004/07/GEP.Cumulus.P2P.BusinessEntities']/*[local-name()='TermsAndCondition' and namespace-uri()='http://schemas.datacontract.org/2004/07/Gep.Cumulus.CSM.Entities']/*[local-name()='TermsConditionText'
    and namespace-uri()='http://schemas.datacontract.org/2004/07/Gep.Cumulus.CSM.Entities']/text()">
    <Extrinsic>
    <HeaderExtrinsic>
    <TermsAndConditions>
    <xsl:for-each select="../s10:TermsAndConditionList">
    <xsl:for-each select="s9:TermsAndCondition">
    <xsl:if test="s9:TermsConditionText">
    <TermsAndCondition>
    <xsl:value-of select="s9:TermsConditionText/text()" /> 
    </TermsAndCondition>
    </xsl:if>
    </xsl:for-each>
    </xsl:for-each>
    </TermsAndConditions>
    </HeaderExtrinsic>
    </Extrinsic>
    </xsl:if>
    [Need to do it in the value coming from termandcondition text ie s9:TermsConditionText]
    Thanks in Advance

    Then go back to the source and explain to them that this is not valid XML, and you cannot consume it. Have you tried opening this XML in a web browser? or have an XML Disassemble Pipeline Component consume it?
    It should be 
    <ns5:TermsConditionText>Terms&amp;conditions</ns5:TermsConditionText>
    From the source, otherwise you will not be able to parse it as XML.
    Morten la Cour

  • Custom XSLT for Biztalk Maps

    Hi,
    I have a input xml file and the output xml file. The input message is multi-part message.
    I have to create a custom xslt to convert input xml to output xml. The xslt should give an xml output. I have an another xslt to take this output as input and create the output in html form.
    Is there any way to convert the existing xslt (which give html output) to the xslt which has to create xml output.
    Thanks,
    Lakshmi

    Hi Lakshmi,
    You can the HTML-XSLT (used to output HTML ) as reference for outputting XML in BizTalk but there is no easy way to achieve it with help of any tool. Especially around the XPaths which can going to be similar.
    For instance, following an XSLT for outputting HTML
    <?xml version="1.0" encoding="utf-8"?>
    <xsl:stylesheet version="1.0"
    xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:ns0="http://biztalk.orderapp.schemas.OrderResponse">
    <xsl:template match="/">
    <html>
    <body>
    <TABLE BORDER="0" cellspacing="2" cellpadding="2" width="90%">
    <TR>
    <TD colspan="8" align="center">
    <H1>Order Confirmation</H1>
    </TD>
    </TR>
    <TR>
    <TD colspan="2">
    <B>Order no : </B>
    </TD>
    <TD colspan="6" align="left">
    <xsl:value-of select="ns0:OrderHeader/ns0:OrderNumber/text()"/>
    </TD>
    </TR>
    </TABLE>
    </body>
    </html>
    </xsl:template>
    </xsl:stylesheet>
    And following an XSLT for outputting XML in BizTalk. You can see the similarities in XPATH and difference around the places they have been used to output HTML and XML.
    <?xml version="1.0" encoding="UTF-16"?>
    <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:msxsl="urn:schemas-microsoft-com:xslt" xmlns:ns0="http://biztalk.orderapp.schemas.OrderResponse" xmlns:var="http://schemas.microsoft.com/BizTalk/2003/var" version="1.0">
    <xsl:output omit-xml-declaration="yes" method="xml" version="1.0" />
    <xsl:template match="/">
    <xsl:apply-templates select="/s3:Registration" />
    </xsl:template>
    <xsl:template match="/ns0:OrderConfirmation">
    <ns0:OrderConfirmation>
    <OrderNoo>
    <xsl:value-of select="ns0:OrderHeader/ns0:OrderNumber/text()" />
    </OrderNo>
    </ns0:Output>
    </xsl:template>
    </xsl:stylesheet>
    If this answers your question please mark it accordingly. If this post is helpful, please vote as helpful by clicking the upward arrow mark next to my reply.

  • Orchestration Variable in Custom XSLT in Biztalk Map

    Hi,
    I have a custom xslt for mapping HL7 messages to CRM fields.
    For one field, I 'll get the data from DB so it is stored in my orchestration variable. How can I use that variable in my custom xslt file? Thanks.
    Regards,
    Lakshmi

    Hi Laxme,
    As far I know, there is no way you can access Orchestration variable in custom XSLT.
    Workaround : you can create a intermediate message with a field and assign the variable value (the data from DB) to it and later use message assignment to assign this value to the field which you want to the mesage which you created using custom
    xslt.
    Maheshkumar
    S Tiwari|User
    Page|Blog|BizTalk
    2013: Inserting RawXML (Whole Incoming XML Message) in SQL database

  • Dvt:map Selection Iterator

    This is a question of urgency. It is holding up a deliverable.
    The dvt:mapPointTheme selectionListener property does not seem to fill the Iterator with the selected data point information any longer. This code used to work in TP4.
    Here is the .jspx code:
    <dvt:mapToolbar mapId="map1"/>
    <dvt:map id="map1" startingX="-98.0" mapServerConfigId="mapConfig1"
    baseMapName="ELOCATION_MERCATOR.WORLD_MAP" mapZoom="3"
    inlineStyle="width:100%; height:400px;" startingY="39.0">
    <dvt:mapPointTheme id="mapPointTheme1"
    value="#{bindings.Load.geoMapModel}"
    selectionListener="#{mapBacking.processSelection}">
    <dvt:mapPointStyleItem imageURL="/loadUnselected.png"
    selectedImageURL="/loadSelected.png"
    shortLabel="Customer Load"
    isDefault="true"/>
    </dvt:mapPointTheme>
    </dvt:map>
    Here is the binding pageDef:
    <mapTheme IterBinding="fetchMoreLoadsIterator" id="Load"
    xmlns="http://xmlns.oracle.com/adfm/dvt">
    <mapThemeDataMap mapThemeType="point">
    <item type="us_form_2" street="street" city="city" state="state"
    zipCode="zipcode" label="cityState"/>
    <item type="data" value="customer" label="Customer"/>
    </mapThemeDataMap>
    </mapTheme>
    Here is the "mapBacking" backing bean:
    public void processSelection(MapSelectionEvent E) {
    if (E.getSelectionMode().equals("Unselect")) return;
    Iterator I= E.getIterator();
    while (I.hasNext()) {
    DataContent DT = (DataContent)I.next();
    String S= DT.getLocationName();
    When the user chooses the "arrow" icon on the map toolBar, then left click on the data point on the map:
    1. The icon changes appearance from "loadSelected.png" to "loadUnselected.png" correctly.
    2. The processSelection(mapSelectionEvent E) backing bean method gets called. But the Iterator is empty.
    When the user uses a selection shape (circle, square..) on the toolbar, then draws a shape around several of the data points on the map:
    1. The icons changes appearance from "loadSelected.png" to "loadUnselected.png" correctly.
    2. The processSelection(mapSelectionEvent E) backing bean method gets called. But the Iterator is still empty.
    This code used to work. We are up against an extremely tight deadline. Is this an dvt:map bug, or is it just something simple we are overlooking.
    Please, we need help ASAP. Thank you gratefully.

    I just tried the following with JDeveloper 11g update 2: Build JDEVADF_MAIN.BOXER_GENERIC_090328.0229.5205
    Create an ADF BC EO/VO/AM based on a table with spatial data.
    Create a page with panelStretchLayout
    Drag the data control to the start area as a Form
    Drag the data control as to the center as a Map
    Define PartialPage rendering so the map updates the form.
    Run the page - clicking points in the map updates the Form.
    Which build are you using?
    Does your ADF BC VO has an attribute marked as key?
    JSF page
    <?xml version='1.0' encoding='windows-1252'?>
    <jsp:root xmlns:jsp="http://java.sun.com/JSP/Page" version="2.1"
              xmlns:f="http://java.sun.com/jsf/core"
              xmlns:h="http://java.sun.com/jsf/html"
              xmlns:af="http://xmlns.oracle.com/adf/faces/rich"
              xmlns:dvt="http://xmlns.oracle.com/dss/adf/faces">
      <jsp:directive.page contentType="text/html;charset=windows-1252"/>
      <f:view>
        <af:document>
          <af:messages/>
          <af:form>
            <af:panelStretchLayout startWidth="300px">
              <f:facet name="bottom"/>
              <f:facet name="center">
                <dvt:map id="map" startingX="0.0" mapServerConfigId="mapConfig1"
                         baseMapName="ELOCATION_MERCATOR.WORLD_MAP" mapZoom="0"
                         inlineStyle="width:100%; height:600px;" startingY="0.0"
                         autoZoomThemeId="mapPointTheme1">
                  <dvt:mapPointTheme id="mapPointTheme1"
                                     value="#{bindings.HousesView1.geoMapModel}"
                                     clickListener="#{bindings.HousesView1.geoMapModel.processClickAction}"
                                     selectionListener="#{bindings.HousesView1.geoMapModel.processSelection}"/>
                </dvt:map>
              </f:facet>
              <f:facet name="start">
                <af:panelFormLayout partialTriggers="map">
                  <af:panelLabelAndMessage label="#{bindings.Id.hints.label}">
                    <af:outputText value="#{bindings.Id.inputValue}">
                      <af:convertNumber groupingUsed="false"
                                        pattern="#{bindings.Id.format}"/>
                    </af:outputText>
                  </af:panelLabelAndMessage>
                  <af:panelLabelAndMessage label="#{bindings.Zip.hints.label}">
                    <af:outputText value="#{bindings.Zip.inputValue}">
                      <af:convertNumber groupingUsed="false"
                                        pattern="#{bindings.Zip.format}"/>
                    </af:outputText>
                  </af:panelLabelAndMessage>
                  <af:panelLabelAndMessage label="#{bindings.City.hints.label}">
                    <af:outputText value="#{bindings.City.inputValue}"/>
                  </af:panelLabelAndMessage>
                  <af:panelLabelAndMessage label="#{bindings.Street.hints.label}">
                    <af:outputText value="#{bindings.Street.inputValue}"/>
                  </af:panelLabelAndMessage>
                  <af:panelLabelAndMessage label="#{bindings.Price.hints.label}">
                    <af:outputText value="#{bindings.Price.inputValue}">
                      <af:convertNumber groupingUsed="false"
                                        pattern="#{bindings.Price.format}"/>
                    </af:outputText>
                  </af:panelLabelAndMessage>
                  <af:panelLabelAndMessage label="#{bindings.Longitude.hints.label}">
                    <af:outputText value="#{bindings.Longitude.inputValue}">
                      <af:convertNumber groupingUsed="false"
                                        pattern="#{bindings.Longitude.format}"/>
                    </af:outputText>
                  </af:panelLabelAndMessage>
                  <af:panelLabelAndMessage label="#{bindings.Latitude.hints.label}">
                    <af:outputText value="#{bindings.Latitude.inputValue}">
                      <af:convertNumber groupingUsed="false"
                                        pattern="#{bindings.Latitude.format}"/>
                    </af:outputText>
                  </af:panelLabelAndMessage>
                  <f:facet name="footer">
                    <af:commandButton text="Submit"/>
                  </f:facet>
                </af:panelFormLayout>
              </f:facet>
              <f:facet name="end"/>
              <f:facet name="top"/>
            </af:panelStretchLayout>
          </af:form>
        </af:document>
      </f:view>
    </jsp:root>pagedef code:
    <?xml version="1.0" encoding="UTF-8" ?>
    <pageDefinition xmlns="http://xmlns.oracle.com/adfm/uimodel"
                    version="11.1.1.52.5" id="untitled5PageDef"
                    Package="demo.view.pageDefs">
      <parameters/>
      <executables>
        <iterator Binds="HousesView1" RangeSize="-1"
                  DataControl="AppModuleDataControl" id="HousesView1Iterator"/>
      </executables>
      <bindings>
        <attributeValues IterBinding="HousesView1Iterator" id="Id">
          <AttrNames>
            <Item Value="Id"/>
          </AttrNames>
        </attributeValues>
        <attributeValues IterBinding="HousesView1Iterator" id="Zip">
          <AttrNames>
            <Item Value="Zip"/>
          </AttrNames>
        </attributeValues>
        <attributeValues IterBinding="HousesView1Iterator" id="City">
          <AttrNames>
            <Item Value="City"/>
          </AttrNames>
        </attributeValues>
        <attributeValues IterBinding="HousesView1Iterator" id="Street">
          <AttrNames>
            <Item Value="Street"/>
          </AttrNames>
        </attributeValues>
        <attributeValues IterBinding="HousesView1Iterator" id="Price">
          <AttrNames>
            <Item Value="Price"/>
          </AttrNames>
        </attributeValues>
        <attributeValues IterBinding="HousesView1Iterator" id="Longitude">
          <AttrNames>
            <Item Value="Longitude"/>
          </AttrNames>
        </attributeValues>
        <attributeValues IterBinding="HousesView1Iterator" id="Latitude">
          <AttrNames>
            <Item Value="Latitude"/>
          </AttrNames>
        </attributeValues>
        <mapTheme IterBinding="HousesView1Iterator" id="HousesView1"
                  xmlns="http://xmlns.oracle.com/adfm/dvt">
          <mapThemeDataMap mapThemeType="point">
            <item type="lat_long" longitude="Longitude" latitude="Latitude"
                  label="Street"/>
            <item type="data" value="Price"/>
          </mapThemeDataMap>
        </mapTheme>
      </bindings>
    </pageDefinition>

Maybe you are looking for

  • HT4623 Ios7 download setup froze my Mac  mini on "Choose a Wi-Fi network"!

    Help! I clicked   Ios7 download, the bar went across the page, and it seemed to be loaded. But then it asked me to select a wireless network, when I entered the name of my network, it froze up, greyed out all but the name I typed and just sat there.

  • Mp3s won't play for most who open my iWeb site

    I am a pianist with an iWeb site. I drop my mp3s on various pages, then a photo on top to make it look cool. Set them to auto play. Most can not cue them when the site or page opens...some can. Would anyone please be willing to help me understand why

  • Upgrading to Lion recommendations

    Hi, I just bought a used mid 2010 mac mini; a 2.4 GHz w/ 8 GB RAM and 320 GB HD.  It currently has 10.6.8 on it.  I want to upgrade to Lion but apprehensive some applications might not work in the new environment. I want to be cautious and like to be

  • Using attchment capability

    HI Experts, I have created the custom tables in ECC6.0 and also created rfc's for getList, getDetails and attachmentPic. The DO, header node is created in NetWeaver Mobile7.1(SDOE_WB), then backend adapters are also created there based on rfcs. All a

  • Itunes 10 missing art work

    I seem to be stuck and cannot figure out why I have lost all my album art work from my iPod (click wheel?) and my new iPhone4.  It appears to have happened after an iTunes update.  Any ideas?  Thanks.