Guys! I need to transform an XML document to HTML. However, as there are many different XML documents that I need to transform I do not and cannot maintain a CSS or an XSL for each of them. Therefore, I am sacrificing that cosmetic finishing which is acceptable. The HTML i get is also acceptable. However, the javax.xml.transform.Transformer class provided by Xalan, which I am using for transformation produces lot of attributes and places them before the html tag in the generated HTML. This is how I create my transformer, tFactory.newTransformer().
This effect is removed when I use an XSL when creating a transformer class through tFactory.newTransformer(xslDocument) and only the correct HTML is produced. If I dont pass an xsl, it gives me unneeded stuff(comments) some of which I paste here. Please inform how can I remove this unnecessary data?
Black = #000000 Green = #008000 Silver = #C0C0C0 Lime = #00FF00 Gray = #808080 Olive = #808000 White = #FFFFFF Yellow = #FFFF00 Maroon = #800000 Navy = #000080 Red = #FF0000 Blue = #0000FF Purple = #800080 Teal = #008080 Fuchsia= #FF00FF Aqua = #00FFFF --><!--=================== Generic Attributes ===============================--><!-- core attributes common to most elements
id document-wide unique id class space separated list of classes style associated style info title advisory title/amplification --><!-- internationalization attributes lang language code (backwards compatible) xml:lang language code (as per XML 1.0 spec) dir direction for weak/neutral text --><!-- attributes for common UI events onclick a pointer button was clicked ondblclick a pointer button was double clicked
I’ve looked at a lot of different solutions, and in my humble opinion Aspose is the way to go. Here’s the link: http://aspose.com