my dog learned polymorphism*
The moose likes XML and Related Technologies and the fly likes Xml Conversion Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Engineering » XML and Related Technologies
Bookmark "Xml Conversion" Watch "Xml Conversion" New topic
Author

Xml Conversion

gianni ipez
Ranch Hand

Joined: Jan 02, 2007
Posts: 65
Hello,
I need to convert an xml file in input, to an xml with a different dtd in output.
I've no idea about how to achieve this task, I don't want you to write the solution for me,
but I 'd be pleased if someone could head me in the right direction.

I think it's intuitive, we have in input a list of books with their chapters. Every chapter in the input file is joined to its book through the idBook.
The input structure is "flat", the output desired structure has a level more of complexity and is less redundant.

Input file:


And here you are what I would expect the program to obtain:



Thank you in advance,
Gianni
Paul Clapham
Bartender

Joined: Oct 14, 2005
Posts: 18541
    
    8

If you want a direction to head in, consider XSLT for converting one XML format to another.
gianni ipez
Ranch Hand

Joined: Jan 02, 2007
Posts: 65
Thank you for the hint.
Here the peculiarity is that in the xml input BOOK is the text node, child of tag KIND,
in the output , BOOK must become an element tag itself.
Does xslt let you make this transformation? How ?
Thank you,
Gianni
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Xml Conversion