Skip to Main Content

DevOps, CI/CD and Automation

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Using XML to merge data

User_7NH8UJul 12 2015 — edited Oct 9 2015

I have two xml documents:

xml1.xml

<root>

    <standardCosts period="May-15" siteNumber="002">

      <wheyCreamStandardCost>2.655</wheyCreamStandardCost>

    </standardCosts>

    <standardCosts period="May-15" siteNumber="999">

      <wheyCreamStandardCost>1.35</wheyCreamStandardCost>

    </standardCosts>

</root>

xml2.doc

<root>

    <standardCosts period="May-15" siteNumber="002">

      <wheyCreamStandardCost>3.00</wheyCreamStandardCost>

    </standardCosts>

    <standardCosts period="May-15" siteNumber="051">

      <wheyCreamStandardCost>2.655</wheyCreamStandardCost>

    </standardCosts>

</root>

I would like to merge xml2.doc onto xml1.doc, using the tag attributes period / siteNumber as keys, to produce the following xml

<root>

    <standardCosts period="May-15" siteNumber="002">

      <wheyCreamStandardCost>3.00</wheyCreamStandardCost>

    </standardCosts>

    <standardCosts period="May-15" siteNumber="999">

      <wheyCreamStandardCost>1.35</wheyCreamStandardCost>

    </standardCosts>

    <standardCosts period="May-15" siteNumber="051">

      <wheyCreamStandardCost>2.655</wheyCreamStandardCost>

    </standardCosts>

</root>

I'm unsure how to proceed. Any ideas?

This post has been answered by odie_63 on Jul 13 2015
Jump to Answer
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Nov 6 2015
Added on Jul 12 2015
9 comments
2,307 views