• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • Liutauras Vilda
  • Jeanne Boyarsky
  • paul wheaton
Sheriffs:
  • Ron McLeod
  • Devaka Cooray
  • Henry Wong
Saloon Keepers:
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
  • Tim Moores
  • Mikalai Zaikin
Bartenders:
  • Frits Walraven

parsing in Xalan

 
Ranch Hand
Posts: 90
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
 
Put a gun against his head, pulled my trigger, now he's dead, that tiny ad sure bled
Gift giving made easy with the permaculture playing cards
https://coderanch.com/t/777758/Gift-giving-easy-permaculture-playing
reply
    Bookmark Topic Watch Topic
  • New Topic