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

Similar Messages

  • BizTalk mapping multiple nodes

    Hello All,
    Below is an example of a schema I have to work upon. There will be multiple nodes of Diviions under the root node and there will be similar number of divisions node under the mappings node. now each divisions node (under root node) will have multiple record
    nodes which will each have an industry_type node. So, what I want to do is match both industry_type nodes (each under root and mappings node) and if the value is same I want to map the industry_type_value to the destination schema. So there can be n number
    of industry_type nodes and I want to have equal number in the destination schema. When I am using a looping functoid along with value mapping I am getting the non matchin industry_type nodes too in the destination schema.
    Please help me with the same.

    Hey Ashwin,
    I am unable to add the xml so am pasting the files:
    Input:
    <ns0:Root xmlns:ns0="http://Pricing.MTB.Schema.Schema1">
      <Divisions>
        <Record>
          <Identifier>node1</Identifier>
          <Industry_Type>ABC</Industry_Type>
        </Record>
        <Record>
          <Identifier>node2</Identifier>
          <Industry_Type>DEF</Industry_Type>
        </Record>
        <Record>
          <Identifier>node3</Identifier>
          <Industry_Type>GHI</Industry_Type>
        </Record>
      </Divisions>
      <Mappings>
        <Record>
          <Industry_type>ABC</Industry_type>
          <Industry_Type_value>ABC0</Industry_Type_value>
        </Record>
        <Record>
          <Industry_type>DEF</Industry_type>
          <Industry_Type_value>DEF0</Industry_Type_value>
        </Record>
        <Record>
          <Industry_type>GHI</Industry_type>
          <Industry_Type_value>GHI0</Industry_Type_value>
        </Record>
      </Mappings>
    </ns0:Root>
    Output:
    <ns0:Root xmlns:ns0="http://Pricing.MTB.Schema.Schema2">
      <Divisions>
        <Record>
          <Identifier>node1</Identifier>
          <Industry_Type>ABC0</Industry_Type>
        </Record>
        <Record>
          <Identifier>node2</Identifier>
          <Industry_Type>DEF0</Industry_Type>
        </Record>
        <Record>
          <Identifier>node3</Identifier>
          <Industry_Type>GHI0</Industry_Type>
        </Record>
      </Divisions>
    </ns0:Root>

  • 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.

  • Strange Errors from Import Server on Schema-based maps for repeating nodes

    I have already posted one thread about this, but perhaps some more in-depth information is required:
    We have uploaded our schema into the console, and have mapped the following multi-node file to it:
    CUSTOMER <repeating node>
      MDM_CUST (new Customer number returned)
      CUSTOMER(mapped back from XI for RECORD MATCHING)
      CREATE_DATE (text field)
      CONTACT<repeating node>
        CONTACT_NO (RECORD MATCHING : NON-QUALIFIER)
        CONTACT_SAP_NO (QUALIFIER)
         [NOTE: There are other qualifers for CONTACT, but only this one
    qualifier is being returned and is the only field that would and should be updated.
    The other fields should be left alone. However, it appears to overwrite EVERYthing
    with NULL other than these two fields. The CONTACT_NO is the sole qualifer on
    the table. It is a calculated field that equals the Auto-ID that is also produced on
    the table - but obviously not mapped.]
      PARTNER<repeating node>
        CUSTOMER_NO (RECORD MATCHING : NON-QUALIFER)
        PARTNER_FUNC (NON-QUALIFIER - Code given to lookup from PARTNER_FUNCTION table which has Code and Desc)
        PARTNER_NO     (NON-QUALIFIER)
        DEFAULT_PARTNER_FLAG (QUALIFIER)
    <CLOSE CUSTOMER NODE>
    In the Customer main table, all records are matched on CUSTOMER. The CONTACT_NO non-qualifer is matched to the CONTACT qualified lookup table directly since it is the only available non-qualifier. For the PARTNER table, the three qualifiers are mapped and then a compound field is created to map to the PARTNER table entry.
    We have the Configurations set at:
    Default Multi-Valued Update: Replace
    Default Qualified Update: Replace
    Default Matching Qualifiers: None
    Our record matching is: Create / Update(ALL MAPPED FIELDS) / Update(ALL MAPPED FIELDS)
    When the map is reused, the repeating nodes are all recognized, be it one node or many. However, when the map is reused, it does not automatically map the values for many of the Partner fields (nor the compound field) though the fields are correctly mapped.
    Also, when we attempt to use Import Server to automate the mapping, we use the mdis.ini set to
    Automap Unmapped Value=True
    Unmapped Value Handling=Add
    Always Use Unmapped Value Handling=False
    We get a very strange error saying that :
    [code]Encountered a pre-SP4 map. The map needs to be upgraded to SP4.
    Solution: Please, Launch the Import Manager GUI using the same source file and simply save the map.[code]
    Could it be that our MDM 5.5 SP4 is not compatible with schemas generated with XI v.7 SP9?
    All of our MDM is 5.5 SP4. It makes no sense that we would get THIS kind of error. Also, I am questioning our combination of these and other configurations since it doesn't always seem to do what it should

    Hi Donald,
    this sounds good so far. Just a short hint: you've set "Default Qualified Update: Replace". This explains why Import server "appears to overwrite EVERYthing
    with NULL other than these two fields.". The reason is the replace. A replace means that the old values are completely deleted and only the new incoming ones are stored. I'd suggest to use any of the Update possibilities.
    Note: the definitions you set in in the record matching step are mainly for the new records in the main table! Records in qualified look ups are handled differently! If you open your map in Import Manager, switch to tab "Map Fields/Values". Select a field that is your non qualifier. Right-Click on it and choose "Set qualified update" from the context menu. Now you can define which qualifiers can be used for the qualified look up matching. And you can define as well what should happen with new and/or existing records.
    Regarding the value mapping: do you use keymapping? Or do you use simple values only? Do you save the map everytime you add a new value mapping?
    Regarding the issue "Encountered a pre-SP4 map. The map needs to be upgraded to SP4. Solution: Please, Launch the Import Manager GUI using the same source file and simply save the map". This sounds very likely like a bug in MDIS and should be reported to SAP!
    Hope that helps
    Michael

  • 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.

  • 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

  • External Context Mapping and "The Mapping to Node...Has Not Been Completed"

    Hi there,
    I've got 2 components: A, B where A consumes the data provided by B.
    I'm calling the component B which includes a view provided by A. This view (provided by A) needs data inputted by the user in a view in B.
    The context of B contains a node called MULTIVALUES flagged as Interface + Input Element Ext.
    The component A uses the component B, in the component usage interface controller of the component A I've referenced the component controller of A. I have then created a node in A's component controller and done the mapping from the component usage interface controller of A to A's component controller.
    The manually created component controller node in A is NOT an interface.
    Now when I invoke B I'm getting an error:
    The Mapping to Node COMPONENTCONTROLLER.1.MULTIVALUES Has Not Been Completed.
    What's still missing?
    Thank you!

    it is indeed much more complex and you need lot of understanding about the component instances and their life time.
    What i do normally for such complex cyclic dependency , i try to split the common part which is needed in bot component_a and component_b and create a new super component_s.
    Component_s is used in both components. You can even go further that you create view component which has nothing but the viewContainer UI elements to embed the views from component_a and Component_b.
    The view component has to create all the used components (comp_s,comp_a,comp_b) and after creating call the interface method in comp_a and comp_b to set the component usage of comp_s (use the if_wd_comp_usage=>entering-referencemode).
    In this way the comp_a,comp_b share the same instance of comp_s.
    What i am saying is to look for a solution in application architecture and not with in the exiting components coding.

  • The Mapping to Node &ATTRIBUTE_NAME& Has Not Been Completed.

    Hi All,
    Could anybody tell me when this exception arises.
    we could not track this exception as all the mappings have been done as desired.
    Need help immediately.
    Regards,
    ARti.

    Hi Aarti,
    I encountered the same problem, but could resolve it.
    There are two kinds of context mapping possible:
    1)Cross component context mapping - In this case, the properties of the interface context node of the used component would look like:
    Interface Node: X
    Input Element (Ext.): must not be set
    Then in the COMPONENT CONTROLLER of the using component, map the desired context node on the left hand side (of the component controller) to the interface node of the used component on the right hand side.
    This is done when we need to receive value of the interface context node of the used component in the using component.
    2)External context mapping: In this case, properties of the interface context node of the used component would look like:
    Interface Node: X
    Input Element (Ext.): X
    Next in the CONTROLLER USAGE in the using component(this is a new node added in the hierarchy in SE80 when displaying the WD component, when component usage has been declared in the current component), right click the desired component usage and select 'Create controller usage'. Now it is here where you define mapping between the interface context node and the context node of the current component controller. By doing this, component controller of the using component would act as the data source.
    This is done when we need to pass value to the used component from the using component.
    The important point to remember is that whenever attribute Input Element (Ext.) of the interface node has been marked as X, ensure to define a mapping for this context, else it results in a runtime error "The Mapping to Node COMPONENTCONTROLLER.1.<interface_context_node> Has Not Been Completed" .
    Regards,
    Chitrali

  • The error is " The Mapping to Node has not been completed

    Hi All,
    I am getting a strange type of error and need help immediately.
    The error is " The Mapping to Node COMPONENTCONTROLLER.1.PLANNING_ENTITY Has Not Been Completed" for the node that exists in the Parent component and is being used in all the child nodes thru reverse mapping.
    I have done mapping in all the child nodes but still the message is coming.
    Could anybody tell me the reason .
    Regards,
    Arti.

    Basically somewhere you have defined a context node 'PLANNING_ENTITY'  to be an Input-Element. At the same time you did not define (through a component usage at design time) where the input to that node is coming from. This means the mapping path to the node is not complete, and the node does not know where it is mapped to.
    Either:
    - You untick the checkbox 'Input-Element (ext.)' inside the controller context, or
    - You find the component that uses the component with the node 'PLANNING_ENTITY' and select Component_Usage->'Name of Usage'->'Add controller usage'. Inside the controller menu you see then, you can now provide a mapping to the context node.
    I realise this now sounds a little confusing, but I'm happy to provide more details should you need them.
    Cheers,
    Robin

  • Mapping one node to many nodes

    How do you map one node in a controller context to many other nodes in another controller context?
    Here's the situation I'd be using this.
    I have an Adaptive RFC model from which I created a Custom Controller. I then used the wizard to map to the model.
    The model corresponds to RFC functions and many of those functions accept the same parameters, LanID for instance. I simply want to have one "LanID" node in a controller that I would set. The change would then propagate to the other LanID context nodes in the Custom Controller mapped to the model.
    What's the best way to handle this?

    If I understand correctly.. B1, B2 and B3 are all in the SAME custom controller?  Even if they are, I don't see a problem of mapping them all to A1 which is in another controller. Let's say that A1 is the "original" node, and B1, B2 and B3 are the "mapped" nodes.
    If you require that B1, B2 and B3 are "original" nodes, and A1 is the "mapped" node, then this is scenario is impossible.
    If you can be more specific, I will try to answer your question better.
    Walter

  • Context Mapping: child-nodes of non-mapped parent nodes

    I am somewhat curious about Context Mapping in WebDynpro.
    Which parents nodes need to be mapped in order to map child nodes ? Does a child node has more than one parent node (e.g. grandparent - two steps above) ?
    A.1  -
    MAPPED----
    >    B.1
      - A1.1   NOT MAPPED
      - A1.2   NOT MAPPED
            - A.1.2.1     MAPPED TO>    B.1.2.4
            - A.1.2.2   NOT MAPPED
      - A1.3   NOT MAPPED
    Is it sufficient that only one of these parent nodes (e.g. direct parent node not mapped, but parent node of this parent node is mapped) need to be mapped so that the child node can be mapped ?
    Is this assumption true or not ?
    The SAP library states:
    "Conversely, child nodes of non-mapped parent nodes cannot be mapped, otherwise this would result in irresolvable conflicts at runtime with respect to the parent-child relation in the context and the mapping relation." (http://help.sap.com/saphelp_nw04/helpdata/de/51/a3384162316532e10000000a1550b0/content.htm)
    This statement is not absolutely clear on this issue.

    Let me put it this way
    You have a node vehicle and you have a child node for that the car. The car node have parameters car1, car2.
    Let the vehicle node have parameters veh1 and veh2
    Then if you map vehicle node one to any other node (say in the comp. controller) you have the option of mapping its children i.e veh1,veh2 and carnode.
    You can have that veh1 is mapped and veh2 is not mapped.
    vehicle node(mapped)
    veh1(may or may not be mapped)
    veh2(may or may not be mapped)
    car node(may or may not be mapped)
    If instead you try to map only the car node the vehicle node will also get mapped automatically but not it's child parameters like veh1 and veh2.
    vehicle node(mapped)
    veh1(may or may not be mapped)
    veh2(may or may not be mapped)
    car nodemapped)
    car1(may or may not be mapped)
    car2(may or may not be mapped)
    Hope this would help.
    Do revert for further clarification
    Regards
    Noufal

  • 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.

  • Oracle SQL - Extracting clob value from XML with repeating nodes

    Hi All,
    I am attempting to run SQL on a table (called test_xml with a column xml_data [data type xmltype]). The column contains xml with repeating nodes (description). The following statement runs successfully when the node contains data of a non clob size:
    SELECT
    extractvalue (Value (wl), '*/description')
    FROM test_xml
    , TABLE (xmlsequence (extract (xml_data, '*/record'))) wl
    but fails when description node contains a lot of data:
    ORA-01706: user function result value was too large
    I amended my query:
    SELECT
    extractvalue(Value (wl), '*/description').getClobVal()
    FROM test_xml
    , TABLE (xmlsequence (extract (xml_data, '*/record'))) wl
    but this fails with:
    ORA-22806: not an object or REF
    Thanks in Advance

    Hi Greg,
    11.2.0.2.0 (Although I will need to do this on my work instance also which is 10.2.0.4)That's gonna be a problem...
    Direct CLOB projection is supported starting with 11.2.0.2, using XMLTable or XMLCast/XQuery functions (extractvalue, extract, xmlsequence are deprecated now) :
    SELECT x.*
    FROM test_xml t
       , XMLTable(
           '/*/record'
           passing t.xml_data
           columns
             description  clob path 'description'
         ) x
    ;On prior versions, implicit conversions will occur to VARCHAR2 datatype, hence the limitation observed.
    AFAIK you have two options on 10.2.0.4 :
    1) Using Object-Relational storage, with the xdb:SQLType="CLOB" annotation.
    2) Using the following trick :
    SELECT dbms_xmlgen.convert(x.description.getClobVal(), 1) as description
    FROM test_xml t
       , XMLTable(
           '/*/record'
           passing t.xml_data
           columns
             description  xmltype path 'description/text()'
         ) x
    ;

  • Map context node  web dynpro to context DATA of  interface controller ALV

    Hi Experts,
    I have started creating simple ALV by following the example in the below mentioned link.
    https://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/3439404a-0801-0010-dda5-8c14514d690d
    I have completed 95% development but stuck with last bit of
    Set data to ALV for display (via reverse context mapping).
    When Click on the Controller Usage button. The component controller of your Web Dynpro component DOES NOT appears on the right side of the screen.
    Therefore I can not  Map context node NODE_FLIGHTTAB of your Web Dynpro component to context DATA of the interface controller of the ALV component.
    Could you please shed me light on this.
    Your time and help much appreciated.
    Best Regards
    CB

    Hi Chandra,
    You need to add component controller first. Just go to the property tab of interface controller of the alv component and click on create button and then add the component controller. After that you'll be able to see the node in the context tab.
    Regards
    Arjun

  • Repeating nodes using FOR loop but when concating XML string then concating only last iteration of FOr loop ??

    I stuck with a problem that I am using FOR loop for generating repeating nodes. 
    Now when I concat the generated node in the main node then I got only last iteration of that FOR loop.
    can anybody suggest me a way to handle this error....
    FOR i IN 1..pl_phone_tab.Count
    LOOP
    SELECT xmlelement("Phone"     
                                        ,xmlelement("PHONETYPE",xmlattributes('01' AS "dmnADRP_PHONETYPE"),pl_phone_tab(i).p_phtype_tab)
                         ,xmlelement("PHONENUM",pl_phone_tab(i).p_phnum_tab)
                         ,xmlelement("PRIMARY_CONTACT",pl_phone_tab(i).p_prcon_tab)
    INTO p_phone_xml
    FROM dual; END LOOP;
    SELECT xmlelement("PhoneInfo"
                           ,xmlconcat(p_phone_xml))
    INTO p_phone_info_xml
    FROM dual;
    here I am getting only one node but there has to be two nodes for PHONE node

    Not that I'm encouraging you but here are two standalone examples explaining how to do what you want :
    1) Loop through the input collection and append each node to its target container :
    SQL> declare
      2 
      3    type t_emp_tab is table of scott.emp%rowtype;
      4 
      5    emp_tab       t_emp_tab;
      6    emp_info_xml  xmltype;
      7    emp_xml       xmltype;
      8 
      9  begin
    10 
    11    -- filling emp_tab with data
    12    select e.*
    13    bulk collect into emp_tab
    14    from scott.emp e
    15    where e.deptno = 10;
    16 
    17    emp_info_xml := xmltype('<EmpInfo/>');
    18 
    19    -- looping through emp collection and appending to EmpInfo element
    20    for i in 1 .. emp_tab.count loop
    21      select appendchildxml(
    22               emp_info_xml
    23             , '/*'
    24             , xmlelement("Emp"
    25               , xmlattributes(emp_tab(i).empno as "id")
    26               , xmlforest(
    27                   emp_tab(i).ename as "Name"
    28                 , emp_tab(i).job as "Job"
    29                 )
    30               )
    31             )
    32      into emp_info_xml
    33      from dual;
    34    end loop;
    35 
    36    dbms_output.put_line(emp_info_xml.getclobval(1,2));
    37 
    38  end;
    39  /
    <EmpInfo>
      <Emp id="7782">
        <Name>CLARK</Name>
        <Job>MANAGER</Job>
      </Emp>
      <Emp id="7839">
        <Name>KING</Name>
        <Job>PRESIDENT</Job>
      </Emp>
      <Emp id="7934">
        <Name>MILLER</Name>
        <Job>CLERK</Job>
      </Emp>
    </EmpInfo>
    PL/SQL procedure successfully completed
    2) Build a secondary collection of XML nodes and use XMLAgg to aggregate them in one go :
    SQL> declare
      2 
      3    type t_emp_tab is table of scott.emp%rowtype;
      4 
      5    emp_tab       t_emp_tab;
      6    emp_info_xml  xmltype;
      7    emp_xml_tab   xmlsequencetype := xmlsequencetype();
      8 
      9  begin
    10 
    11    -- filling emp_tab with data
    12    select e.*
    13    bulk collect into emp_tab
    14    from scott.emp e
    15    where e.deptno = 10;
    16 
    17    -- looping through emp collection and appending to the collection of Emp nodes
    18    for i in 1 .. emp_tab.count loop
    19 
    20      emp_xml_tab.extend;
    21 
    22      select xmlelement("Emp"
    23             , xmlattributes(emp_tab(i).empno as "id")
    24             , xmlforest(
    25                 emp_tab(i).ename as "Name"
    26               , emp_tab(i).job as "Job"
    27               )
    28             )
    29      into emp_xml_tab(i)
    30      from dual;
    31 
    32    end loop;
    33 
    34    select xmlelement("EmpInfo", xmlagg(t.column_value))
    35    into emp_info_xml
    36    from table(emp_xml_tab) t ;
    37 
    38    dbms_output.put_line(emp_info_xml.getclobval(1,2));
    39 
    40  end;
    41  /
    <EmpInfo>
      <Emp id="7782">
        <Name>CLARK</Name>
        <Job>MANAGER</Job>
      </Emp>
      <Emp id="7839">
        <Name>KING</Name>
        <Job>PRESIDENT</Job>
      </Emp>
      <Emp id="7934">
        <Name>MILLER</Name>
        <Job>CLERK</Job>
      </Emp>
    </EmpInfo>
    PL/SQL procedure successfully completed
    Both solutions give the same output.
    Test them both and see which one fits better into your scenario.

Maybe you are looking for

  • Using a different color for each event in a calendar?

    I don't know if this is possible. If I have a calendar that is green. Every event I set up in that calendar is green. So if you have a full day of events each day on the calendar just looks like this mass of green. Is there any way (as I've seen in o

  • TS2818 Having trouble connecting iphone to itunes in windows 8

    Got a new computer with Windows 8, downloaded iTunes and now can't connect my iPhone to iTunes.  Any help is appreciated

  • Accessing procedure in a package.

    I have two procedures in a package.. I need to access them, and how am i to take the results from a VArray.. Kindly help me on this...

  • Home button unresponsive due to Mail?

    I've recently started to notice that my home button has been a little unresponsive. Sometimes a single click won't work at all and it takes a few tries to get it to quit an app. Someitmes two clickes does what one click is supposed to do, sometimes i

  • Embedded OC4J  - Web Service works... not OC4J!

    I have a very interesting issue here.. when I run my EJB 3.0 - Web service in Jdeveloper using the embedded OC4J, I am able to successfully test my services. But, When I deploy the Web service to an OC4J server, I get the folowing error when I try to