• 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
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

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,
 
I will suppress my every urge. But not this shameless plug:
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic