• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Paul Clapham
  • Tim Cooke
  • Devaka Cooray
Sheriffs:
  • Liutauras Vilda
  • paul wheaton
  • Rob Spoor
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • Piet Souris
  • Mikalai Zaikin
Bartenders:
  • Carey Brown
  • Roland Mueller

Mapping Elements to new Elements

 
k j
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi all,
I am attempting to read in a XML document A, and then match the element content in A and map these to XML elements stored in another document.
So I parse Doc A which results in a DOM containing tags:
</DocA><a>test1</a><b>test2</b></DocA>
And the aim is to take the information in these elements and map this information to the tags in Doc B:
<NewDoc><c></c><d></d></NewDoc>
So the result is Document B, which looks like the following:
<DocB><c>test1</c><d>test2</d></DocB>
So tag <a> in Doc A is mapped to tag <c> in Doc B, and tag <b> in Doc A is mapped to tag <d> in DocB.....

Any suggestions, pointers in the right direction would be much appreciated as I am farily knew to this. Is there a suggested way of storing the tag names with mapping details?
Cheers,
 
Uh oh, we're definitely being carded. Here, show him this tiny ad:
We need your help - Coderanch server fundraiser
https://coderanch.com/wiki/782867/Coderanch-server-fundraiser
reply
    Bookmark Topic Watch Topic
  • New Topic