How to translate XML from one schema to another?

I want to translate XML documents with a specific schema to another schema. I know both old and new circuits ...

I am planning to use the python xml.dom library and translate line by line.

Any ideas on how to do this? Any tools or libraries in other languages ​​that can make this easier and more efficient.

Thank!

+1


source to share


3 answers


You can create XSLT to do this job. XSLT is specifically designed for translating XML data into other textual formats, including XML. For more information on XSLT, I recommend W3 Schools .



+4


source


This is what XSLT was designed for. Since you know both schemas, you are writing an XSLT sheet that takes the original document and transforms it into a new schema. This is especially useful if there is a one-to-one mapping from the old schema to the new one.



+1


source


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

0


source







All Articles