Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Xml Conversion

 
gianni ipez
Ranch Hand
Posts: 65
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Sheriff
Pie
Posts: 20196
26
MySQL Database
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If you want a direction to head in, consider XSLT for converting one XML format to another.
 
gianni ipez
Ranch Hand
Posts: 65
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic