Question

I want to translate xml documents with a certain schema into another schema. I know both the old and new schemas...

I am planning to use python's xml.dom library , and translate line by line.

Any ideas on how to go about it ? Any tools or libraries in other languages that might make this easier/more efficient.

Thanks!

Was it helpful?

Solution

You could craft an XSLT to do this work for you. XSLT is specifically designed for the translation of XML data into some other text-based format, including XML. For more information on XSLT, I recommend W3 Schools.

OTHER TIPS

This is what XSLT was designed for. Since you know both schemas then you write an XSLT sheet that takes the original document and transforms it into the new schema. Its especially easy if there is a one to one mapping from old schema to new.

XSLT is the "recommended" way of doing it. However, you could probably do it faster with your python xml dom if you are familiar with python. Learning XSLT is a good idea though. I have to do this myself and I will be doing it with perl.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top