I have the XML file I want to transform this XML to below format.
Any Help using DOM4j.
posted 2 years ago
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.