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

XML Generation with Freemarker Templates.

 
Rakesh Jhamb
Ranch Hand
Posts: 154
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have a predefined XML schema (XSD file). I need to generate a XML according to that XSD and populate the tag values from Java Objects...
Right now, there is a built solution that is able to create XML, but the problem is that inside the java code, we are manually creating the XML document and also there is lot of code for appending child tags into the parent tags for creating the XML layout.
The code is unmaintainable.

I am in the process of simplifying this proces...

My question is that is it possible to generate a sample XML from XSD, and use freemarker to populate XML tag values from java objects at runtime...is this a good way to achieve what I intend, or do I need to follow some different path like XSLT or something else.
 
Rakesh Jhamb
Ranch Hand
Posts: 154
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I request ranchers to please reply to my post.
 
Paul Clapham
Sheriff
Pie
Posts: 20188
26
MySQL Database
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Rakesh Jhamb wrote:I have a predefined XML schema (XSD file). I need to generate a XML according to that XSD and populate the tag values from Java Objects......


Okay. There are a lot of products which allow you to map Java objects to XML documents. JAXB is just one of them, for example.

I don't know anything about Freemarker but I looked at their FAQ and it doesn't include the word "schema".
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic