How to merge two xmls.

Hi All,
I want to merge two xmls in my output. My scenario is I am getting two sets of outputs and I want to merge them to get my final output. I my output I have a header and a Lineitem. I my final output I want to keep header only once and all the LineItems one by one.Can anyone suggest something.
First outout:-
<outputVariable>
-<part name="payload" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
-<SiebelOrderQueryByExample_Output xmlns="http://siebel.com/asi/">
-<ns:SiebelOrderQueryByExample_Output xmlns:ns="http://siebel.com/asi/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
-<ListOfOrderInterface xmlns="http://www.siebel.com/xml/Siebel%20Order">
<Orders>
<Id>1-15IXJ</Id>
<OrderNumber>1012-1234</OrderNumber>
<ListOfLineItems>
<LineItems>
<Id>1-15IY3</Id>
<OrderNumber>1012-1234</OrderNumber>
<LineNumber>301</LineNumber>
</LineItems>
</ListOfLineItems>
</Orders>
</ListOfOrderInterface>
Second output:-
<outputVariable>
-<part name="payload" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
-<SiebelOrderQueryByExample_Output xmlns="http://siebel.com/asi/">
-<ns:SiebelOrderQueryByExample_Output xmlns:ns="http://siebel.com/asi/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
-<ListOfOrderInterface xmlns="http://www.siebel.com/xml/Siebel%20Order">
-<Orders>
<Id>1-15IXJ</Id>
<OrderNumber>1012-1234</OrderNumber>
<ListOfLineItems>
<LineItems>
<Id>1-15IW2</Id>
<OrderNumber>1012-1234</OrderNumber>
<LineNumber>302</LineNumber>
</LineItems>
</ListOfLineItems>
</Orders>
</ListOfOrderInterface>
The required output which I want after merging.
<outputVariable>
-<part name="payload" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
-<SiebelOrderQueryByExample_Output xmlns="http://siebel.com/asi/">
-<ns:SiebelOrderQueryByExample_Output xmlns:ns="http://siebel.com/asi/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
-<ListOfOrderInterface xmlns="http://www.siebel.com/xml/Siebel%20Order">
-<Orders>
<Id>1-15IXJ</Id>
<OrderNumber>1012-1234</OrderNumber>
<ListOfLineItems>
<LineItems>
<Id>1-15IW2</Id>
<OrderNumber>1012-1234</OrderNumber>
<LineNumber>302</LineNumber>
</LineItems>
<LineItems>
<Id>1-15IY3</Id>
<OrderNumber>1012-1234</OrderNumber>
<LineNumber>301</LineNumber>
</LineItems>
</ListOfLineItems>
</Orders>
</ListOfOrderInterface>
Thanks

I am not using file adapter. I am taking inputs from the BPEL client and displaying output to the client. My input xsd is:-
<?xml version="1.0" encoding="UTF-8" ?>
<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns="http://www.example.org/ns/intorder"
targetNamespace="http://www.example.org/ns/intorder"
elementFormDefault="qualified">
<xsd:element name="order" type="orderType">
<xsd:annotation>
<xsd:documentation>
A sample element
</xsd:documentation>
</xsd:annotation>
</xsd:element>
<xsd:complexType name="orderType">
<xsd:sequence>
<xsd:element name="Order_Number" type="xsd:string"/>
<xsd:element name="Line_item" type="LineType" maxOccurs="unbounded" minOccurs="0"/>
</xsd:sequence>
</xsd:complexType>
<xsd:complexType name="LineType">
<xsd:sequence>
<xsd:element name="Line_Number" type="xsd:string" />
</xsd:sequence>
</xsd:complexType>
</xsd:schema>

Similar Messages

  • How to merge two XML's with JDOM?

    How to merge two xmls's using jdom? like:
    is there a way to add the complete content one xml into the parent node of another xml?
    //in.xml
    <?xml version="1.0"?>
    <people>
    <person>
      <name>ABC</name>
      <email>[email protected]</email>
    </person>
    </people>
    //out.xml
    <?xml version="1.0"?>
    <address>
    <city> abccounty</city>
    <state> abcstate</state>
    </address>
    Merged XML:
    <?xml version="1.0"?>
    <people>
    <person>
      <name>xyz</name>
      <email>[email protected]</email>
    </person>
    <address>
    <city> abccounty</city>
    <state> abcstate</state>
    </address>
    </people>
    import java.util.List;
    import org.jdom.Document;
    import org.jdom.Element;
    import org.jdom.input.SAXBuilder;
    import org.jdom.output.Format;
    import org.jdom.output.XMLOutputter;
    public class MergeXMLS {
         public static void main(String[] args) {
              try{
                  SAXBuilder builder = new SAXBuilder();
                  Document books = builder.build("D:/in.xml");
                  Document onebook = builder.build("D:/out.xml");
                  Element root = books.getRootElement();
                  List rows = root.getChildren();
                  for (int i = 0; i < rows.size(); i++) {
                      Element row = (Element) rows.get(i);
                      onebook.getRootElement().addContent(row.detach());
                      System.out.println(row.getName());
                  new XMLOutputter(Format.getPrettyFormat()).output(onebook, System.out);
              }catch(Exception e){
                   e.printStackTrace();
    }

    The above code only add's the first node.
    I changed the code little differently to
                  SAXBuilder builder = new SAXBuilder();
                  Document books = builder.build("D:/in.xml");
                  Document onebook = builder.build("D:/out.xml");
                 //trying to add second xml into the first
                  books.getRootElement().addContent(onebook.getRootElement().getContent()); 
                  new XMLOutputter(Format.getPrettyFormat()).output(books, System.out);
    here is the exception from the above code:
    org.jdom.IllegalAddException: The Content already has an existing parent "address"
         at org.jdom.ContentList.add(ContentList.java:218)
         at org.jdom.ContentList.add(ContentList.java:140)

  • Merging two xmls

    Hi,
    Just for information..
    How to merge two xmls
    1. convert the xml documents to xml variables using setValue activity. Only equating will convert xmlDoc to xml Variable.
    2. serialize() each xml input variable. Each variable will get converted to string
    3. concatenate both serialized variable and assing it to xml output variable. deserialization is not require. after concatenationg add root nodes if require.
    Regards
    Sunil

    Thanks for the reply!
    Can you please tell me in steps how can i achieve this using JAXP and DOM
    In steps in the sense : first convert xml's to something then do something.
    Thanks in advance.

  • How to merge two repositories using(MUD)

    hi all,
    how to merge two repositories using mude, for example i have sh rpd and paint rpd how to merge two repositories using Multi user development(mud), please don't give venkat forums link and oracle's training doc links.
    Is this possible? if it is possible please help me .
    Thanks
    Naresh

    Hi Naresh,
    What you could do is:
    1. do a ontime command line merge of both repository using the nqudmlexec tool
    2. In the mergerd repository created two project (sh and paint) and assign one bussiness model to each project.
    3. Make this the master repository for your MUD.
    4. Check the projects in and out.
    regards
    John
    http://obiee101.blogspot.com

  • How to merge two search button from different criteria

    How to merge two search button from different criteria
    this image show the question
    http://s24.postimg.org/4algthuj9/1111.jpg
    two different criteria for the same view and I need to merge it in one button as when I click
    on the button search result give from two criteria parameters

    You can!t using af:query. the af:query component comes as is. If you can't do it through the properties, you probably can't do it at all.
    As in your other thread, the way to go is to program your own search form. This way you can use a layout and functionality you like.
    For this you create a form with input fields for the values you are searching for, put them on hte page in a way you like and in the end by hitting on a button (e.g. called Search) map all inputfields to parameters of a service method you defined in your application module or VO. This service method then executes a view criteria returning all matches in the default iterator (just as if you had used af:query.
    Timo 

  • Merge two XML files From java

    hi,
    i'm in need to merge two XML files from my java code please help me as soon......

    Rajesh42 wrote:
    hi,
    i'm in need to merge two XML files from my java code please help me as soon......Hello Rajesh42,
    While it is wonderful that you have discovered the magically code tags, please consider if it is the right time to use them. Code tags should only go round code. Note used to make your posts "stand out", or used to quote other people. Just code.
    As to your question, what have you tried, what are you stuck on?
    Mike

  • How to compare two xml schemas

    Hello guys,
    How to compare two xml schemas? is there any tool for that?
    Thanksinadvance
    kavita//

    XML Files may be compared with the oracle.xml.differ.XMLDiff class.
    A file consisting of the differences in the xml files gets generated. An XSLT to convert one file to the other also gets generated.

  • [Help] How to merge two rows in a datagrid?

    How to merge two rows of a specific column in a datagrid?
    ex.
    |_______|_____|_____|
    | merged |_____|_____|
    |_______|_____|_____|
    |_______|_____|_____|
    thx a lot~

    I need to merge column heading. Have u find any solution for
    ur problem?

  • How to merge two cells in a row

    hi freinds,
    how to merge two cells in alv grid using oops.
    for eg ,in the first row there is text premraj
             n in the second row there is cheguri
              my requriment is two merge the two cells ie to remove the horizontal line between them
    thanks & regards,
    premraj

    Well, as a new member you should learn to search the forum first before posting questions. Using keywords like "jtable merge cell" will find other postings on this topic. Some with solutions some without, so you will need to read a few and decide on the approach you want to take.

  • How to merge two accounts?

    How to merge two accounts apple id and icloud (purchase)?

    You can't. See: http://support.apple.com/kb/HT4895

  • How to merge two adjacent partitions?

    How to merge two adjacent partitions?

    The formal steps are delete the second partition and right click on first one, choose "extend".
    Of course this will erase data on second partition.
    Some third party tools can help do the job with keep data on second partition. 
    If you have any feedback on our support, please send to [email protected]

  • How to merge two Outlook 2010 pst data files?

    How to merge two Outlook 2010 pst data files?

    Easy way: with the one you want to use open in Outlook and the other one not in your profile, go to File, Open, Import.
    If you only want to merge some content, open both pst files in outlook and drag between folders. For calendar, use a list view to see all of the appointments.
    Diane Poremsky [MVP - Outlook]
    Outlook Daily Tips |
    Outlook & Exchange Solutions Center
    Subscribe to Exchange Messaging Outlook weekly newsletter

  • How to merge two conflicting contact on iPhone and on laptop?

    How to merge two conflicting contacts?
    When syncing my iPhone w/ my Mac laptop, it seems that Apple does not provide an option that allows you to merge the data from two conflicting contacts.  For example, you have a contact on your iPhone for Andy Summer and a contact on your laptop for Andy Summers - one contact contains only Andy's name and email address, the other contact contains only Andy's name and his mailing address.  I'd like to be able to merge the data from these two contacts into one and save it to both, but the Conflict Resolver in the syncing program (I think it's in iTunes) does not offer an option for merging the two.
    Does anyone have any knowledge about 1) how to merge data from two conflicting contacts, or 2) some other way to keep the data from each so that I don't have to choose one over the other?

    Jawad,
    First of all,You need to make teaming on both the interfaces on the server side.Which mode do you want to use? Active-Active or Active-Standby.
    Server side :Active-Active - You need to configure the switch side to be a etherchannel/LACP. It can be done by the commands on the cisco 4006.
    Server side :Active-Standby - You need nothing to do at the switch side.
    Note: Seems PAGP is a proprietary of cisco. Server shouldn't know that. To be bound with mode "on" of "lacp" should be fine. It depends on the server side as well.
    HTH
    Thot

  • How to merge two movies documents into 1 in  iTunes?

    Can anyone tell me how to merge two movies documents into one in iTunes? Sorry maybe this is an easy and dumb question for you, but I have totally no idea. I download some movies in Windows and use Kigo Video Coverter to converte them into mp4 format. So I can watch it through new Apple TV in my big screen TV. Now I am thinking maybe I can upgrade my experience a bit more. Because some movies are downloaded into 2 or 3 separated document and I have to choose and click them while seeing. Is there any software can merge those separated documents into one single in mp4 format? I wish you could give me several to choose . Freeware is better. Thanks in advance.

    Thanks. I've tried simplemovies application but it seems too much complicated for me. I read some passages online and bought Quicktime Pro ($30) and finally link 2 mp4 documents together. So easy. Only issue is I have to pay $ 30 .

  • How to merge two different images in photoshop?

    I am new here. I am starting to learn photoshop.How to merge two different images in photoshop? Please guide me. Thankyou.
    http://www.nissiinfotech.com/

    SPAM

Maybe you are looking for

  • IPod Touch (4th generation) won't connect to wifi! Please help!

    My iPod Touch (4th generation) won't connect to my house wifi that it's always connected to. I tried forgetting the network, and putting the password in again, several times. I've tried restarting my iPod, turning the wifi on & off, and also turning

  • Adobe Flash player 16.0.0.235 crashes on Firefox 34.0.5, Windows 7

    I recently installed Adobe Flash player 16.0.0.235 and now it always crashes wherever I try to watch a video on Firefox 34.0.5 on Windows 7. I tried all the troubleshooting advice from Firefox (checking that Flash is installed properly, checking to s

  • Set Text Item To SQL Query Result

    I am trying to set a text item to a SQL query result. Something like the following: (I am trying to accomplish this in the SOURCE portion, set to 'SQL Query' source type, of the text item properties) SELECT empno FROM emp WHERE empno = :SEARCH_EMPNO;

  • Order Pricing

    Hi, If the pricelist Price line is changed after Order Entry in OM, is the changed price honored for existing Order Lines? (order lines are unreleased or Release is eligible)

  • Converting photos in raw converter

    How come some photos will convert into raw converter and others won't canon 3