This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
The moose likes XML and Related Technologies and the fly likes Conversion to XML Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Engineering » XML and Related Technologies
Bookmark "Conversion to XML" Watch "Conversion to XML" New topic

Conversion to XML

vivek dhiman
Ranch Hand

Joined: Aug 05, 2011
Posts: 111


I have the XML file I want to transform this XML to below format.

Any Help using DOM4j.
g tsuji
Ranch Hand

Joined: Jan 18, 2011
Posts: 499
The core functionality sought after through the xslt is achieved via the template like this.

The translate() is just a minimum attempt to guard against invalid tag name because in principle nothing guarantees the attribute Name contains a valid string acceptable to be a tag name, nothing except you have a validating parser and a schema to validate the xml instance against it. It collapses the space and it is only one way amongst others. The instance you show has no problem to do without it but again there is no guarantee in general some other instances are as good. If you're sure there is none that poses problem in that regard, you can do without it.

dom4j supports xslt and it works just like any other processing library which supports xslt. That part is kind of routine as long as you know xslt; if not, you've some readings to do before taking on the issue xslt-way.
I agree. Here's the link:
subject: Conversion to XML
Similar Threads
saving the details in when i click next and previous buttons
JavaPOS EPSON printer
Passing data to and from a jsp page
java.util.ArrayList is not compatible with class java.lang.String exception (SOLVED)
Migrating from Spring 2.0 and Hibernate 3.0 to Spring 3.1 and Hibernate 4.1