Click here to Skip to main content
Licence CPOL
First Posted 2 May 2007
Views 34,375
Downloads 756
Bookmarked 29 times

XML to XML Mapping Tool

By | 9 May 2007 | Article
XML2XML is a mapping tool to transform XML data from one XML format to any another XML format.

Introduction

XML2XML is a mapping tool to transform XML data from one XML format to any another XML format. This tool is simple to use, just drag and drop the source XML node on the target XML node and see the generated XSL and output XML. That's easy!

Make sure your source XML does not have repeating XML elements. The source XML structure should look like the XML schema to get better results. The generated XSLT can be used to generate XML data from your source XML. This tool doesn't give a visual representation of the mapping nodes but at least show you which source and target XML nodes are mapped. If the node icon is violet, that means the node has mapped to something. Okay, looks good. How do we know which target node was mapped to which source node? Wait, here it is, simply click on the target tree node. If it is mapped to a node in the source XML, then a node on the source tree should be highlighted (grayed node). Well, mappings are done and if you save the mappings for future use, we can save the current mappings using the File menu. When you open the mapping file again, make sure the XML files are on the same location when you saved the mapping.

That is it, your mapping file (XSLT) is ready to use.

Screenshot - xml2xml.jpg

Sample Files

Source XML:
<?xml version='1.0'?>
<bookstore>
  <book>
    <title>The Autobiography of Benjamin Franklin</title>
    <author>
      <first-name>Benjamin</first-name>
      <last-name>Franklin</last-name>
    </author>
    <price>8.99</price>
  </book>
</bookstore>
Target XML:
<?xml version='1.0'?>
<myLibrary>
  <book>
    <title></title>
    <authorFirstName></authorFirstName>
    <authorLastName></authorLastName>
    <value></value>
  </book>
</myLibrary>

How to Use

  1. Open the source XML file.
  2. Open the target XML file.
  3. Drag the source tree node and drop on the target tree node.
  4. Continue step 3 to map the source XML nodes.
  5. Click on the XSL tab to view the generated XSL.
  6. Click on the Output tab to view the transformed XML.
  7. Save the mappings if you want to update in future.
  8. To remove mapping from a single node, right click on the target tree node and click on the "Remove Mapping" context menu.
  9. To remove all the mappings, right click on the target tree node and click on the "Remove All Mappings" context menu.

History

  • 5/2/2007: Created.

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

About the Author

Srinivas-Miriyala

Software Developer (Senior)

United States United States

Member



Sign Up to vote   Poor Excellent
Add a reason or comment to your vote: x
Votes of 3 or less require a comment

Comments and Discussions

 
You must Sign In to use this message board. (secure sign-in)
 
Search this forum  
 FAQ
    Noise  Layout  Per page   
  Refresh
GeneralAttribute Support PinmemberNick Yzzi9:11 9 Mar '10  
QuestionDoes it support 1:n or n:m mappings? Pinmembersakonia1323:06 31 May '09  
QuestionNeed automatic xmltoxml converter PinmemberSneh4Pranav5:57 7 Jul '08  
GeneralTry the following Pinmemberintrader7:55 8 May '07  
AnswerRe: Try the following PinmemberSrinivas-Miriyala5:35 9 May '07  
Generalhow to design an xml2xml tool Pinmembernagasheetal2:46 14 May '08  
Generalgood idea PinmemberBoniolopez23:04 7 May '07  

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.

Permalink | Advertise | Privacy | Mobile
Web03 | 2.5.120517.1 | Last Updated 9 May 2007
Article Copyright 2007 by Srinivas-Miriyala
Everything else Copyright © CodeProject, 1999-2012
Terms of Use
Layout: fixed | fluid