?
Solved

Merge two xml documents

Posted on 2001-08-02
9
Medium Priority
?
379 Views
Last Modified: 2008-02-01
Hi,
  I have two xml documents stored as OracleXMLDocGenString objects doc1 & doc2, each of them generated through the qry.getXML() method. Now i want to merge the two documents into a third OracleXMLDocGenString Object doc.

I tried the method docAppend in OracleXMLDocGenString
like
doc.createNewDocument(true);
doc.docAppend(doc1);
doc.docAppend(doc2);
but this appends a null to my document doc instead of the xml.

The doc1.getXMLDocumentString() & doc2.getXMLDocumentString() returns the whole 347 records i have in my xml document and so i am sure the objects doc1 and doc2 are properly created.

Can anyone tell me how i can merge the two documents into one.

Thank you
Suresh
0
Comment
Question by:sureshabb
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 2
  • 2
  • +1
9 Comments
 
LVL 27

Expert Comment

by:BigRat
ID: 6353740
I suspect that the API definition of docAppend() takes a node list or an XML string and not a "document". I tried to find an API specification for the call on the Oracle site but they restrict passwords to 6-16 characters and Rat's don't like that!

So I would suggest you either try to post the API and/or try something along the lines :-

    doc.docAppend(doc1.document());
or
    doc.docAppend(doc1.getXMLDocumentString());

HTH
0
 

Author Comment

by:sureshabb
ID: 6357881
Thank you for the research. The API was defined for the parent class OracleXMLDocGen.
So i had to redefine the doc, doc1 and doc2 as OracleXMLDocGen instead of OracleXMLDocGenString and then populate them with the qry.getXML()
A Method newDocGenDoc helped me create a child node to be appended to the parent doc.

Suresh
0
 
LVL 27

Accepted Solution

by:
BigRat earned 200 total points
ID: 6361153
Oh dear! How complicated.

Well I'm not "au fait" with Oracle APIs but if the documents are not too big I would be tempted to convert them into strings, use a bit of script to put them together with a new <root> and stick the resultant document back into a DOM.
0
What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

 
LVL 1

Expert Comment

by:Moondancer
ID: 6789975
It's time to clean up this topic area and that means taking care of this question. Your options at this point are:

1. Award points to the Expert who provided an answer, or who helped you most. Do this by clicking on the "Accept Comment as Answer" button that lies above and to the right of the appropriate expert's name.

2. PAQ the question because the information might be useful to others, but was not useful to you. To use this option, you must state why the question is no longer useful to you, and the experts need to let me know if they feel that you're being unfair.

3.  Ask Community Support to help split points between participating experts.  Just comment here with details.

4.  Delete the question because it is of no value to you or to anyone else.  To use this option, you must state why the question is no longer useful to you, and the experts need to let me know if they feel that you're being unfair.

If you elect for option 2, 3 or 4, just post comment with details here and I'll take it from there.  We also request that you review any other open questions you might have and update/close them.  Display all your question history from your Member Profile to view details.

PLEASE DO NOT AWARD THE POINTS TO ME.
____________________________________________
---------->  Hi Experts:

In the event that the Asker does not respond, I would very much appreciate your opinions as to which Expert ought to receive points (if any) as a result of this question.  Likewise, you can also suggest that I PAQ or delete the question.

------------->  The ALL TOPICS link has been updated today to reflect all the new TAs.

Thank you everyone.

Moondancer :)
Community Support Moderator @ Experts Exchange
0
 
LVL 23

Expert Comment

by:b1xml2
ID: 6946873
<review>

<recommendation>
delete question
</recommendation>

<objection>
any objection should be raised within 7 days
</objection>

<reviewer>
b1xml2
</reviewer>

</review>
0
 
LVL 23

Expert Comment

by:b1xml2
ID: 6947311
thank you for finalising this question. As usual, you shd provide explanation for grades other than A.
0
 
LVL 1

Expert Comment

by:Moondancer
ID: 6947889
Thanks for returning and finalizing your questions.  Please let us know where we fell short of expectations, given you've assigned a "B" grade versus "A".  If this was in error, I can correct this.  Your points remains the same, but the expert points that flow are a direct result of the grades assigned.  If you found additional information outside this question thread, and can add it here, that will help others as they access this item looking for solutions in the future.

Moondancer - EE Moderator
0
 

Author Comment

by:sureshabb
ID: 6948373
Sorry the grade should be 'A'
0
 
LVL 1

Expert Comment

by:Moondancer
ID: 6958491
Thank you, this has been corrected.
Moondancer - EE Moderator
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction In my previous article (http://www.experts-exchange.com/Microsoft/Development/MS-SQL-Server/SSIS/A_9150-Loading-XML-Using-SSIS.html) I showed you how the XML Source component can be used to load XML files into a SQL Server database, us…
Many times as a report developer I've been asked to display normalized data such as three rows with values Jack, Joe, and Bob as a single comma-separated string such as 'Jack, Joe, Bob', and vice versa.  Here's how to do it. 
This is my first video review of Microsoft Bookings, I will be doing a part two with a bit more information, but wanted to get this out to you folks.
How to fix incompatible JVM issue while installing Eclipse While installing Eclipse in windows, got one error like above and unable to proceed with the installation. This video describes how to successfully install Eclipse. How to solve incompa…

762 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question