Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Java: Mapping XML to other XML (translation)

To put this simply, I would like to make a java program that takes one xml file (in format x) as input, translate it to XML format y, maybe do some other stuff to it, and then output it.

Format x and y are fairly similar (both used in NLP tools, have same kind of tokens etc.) and I also have the description schemas for both of them. In case you're curious, I'd like to translate something to TCF format; make a bridge between 2 tools.

I've never done this before, how does one go about mapping one xml to another? Can you recommend some libraries or tools? (this has to be usable in eclipse though, and should be free)

So far I found this program from stylus studio, but it's not free and even though it looks pretty cool, I'm not sure if it's output would be of any use for my java program.

If the result of this conversion is an XSLT, can I use it in java? (how does this xslt work for translating?) (so that I'd maybe use their GUI to map everything once, and then keep using the resulting xslt somehow in my program)

Many thanks for any shedding of light on the matter!

like image 734
Spectraljump Avatar asked Jan 28 '26 16:01

Spectraljump


1 Answers

Use XML Transformations, which is implemented by a set of classes built into the jdk, see

http://www.brics.dk/~amoeller/XML/transformation/index.html

for a tutorial.

like image 149
MeBigFatGuy Avatar answered Jan 30 '26 04:01

MeBigFatGuy



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!