Granny's Programming Pearls
"inside of every large program is a small program struggling to get out"
JavaRanch.com/granny.jsp
  • 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 all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Liutauras Vilda
  • Jeanne Boyarsky
  • Devaka Cooray
  • Paul Clapham
Sheriffs:
  • Tim Cooke
  • Knute Snortum
  • Bear Bibeault
Saloon Keepers:
  • Ron McLeod
  • Tim Moores
  • Stephan van Hulst
  • Piet Souris
  • Ganesh Patekar
Bartenders:
  • Frits Walraven
  • Carey Brown
  • Tim Holloway

IBM XML Parser to generate HTML output

 
Ranch Hand
Posts: 96
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am using IBM XML parser ....The input is XMl and the output is an HTML report .Can somebody tell me which all IBM java objects can create a dynamic HTMl .....The concept is simlar like how a Servlet builds an HTML...The PAI being used is DOM....Uptil now i have been able to create only XML output from XMl input..need to know how to create HTML output??
Please help
 
Sheriff
Posts: 5782
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You have the following options

  • Create a XSL stylesheet that captures all of your presentation requirements and have a (hardcoded) static link in the XML file.
    Advantages - no additional coding.
    Disadvantages - hard to change, will not work for XML files generated outside your organizational boundaries unless you "attach" the stylesheet reference to the document. Also this approach introduces some level of browser dependency since you are serving the XML directly to the client browser.
  • Create XSL stylesheets but write programs to do the XSL Transformations on the server using XSLT APIs. Checkout Xalan from Apache.
    Advantages - Opens up options for more dynamic output generation. The XSLT API allows you to add your own "hooks" to control and affect the transformation process.
    Disadvantages - Some server-side coding required, which means changes to the output format will result in changes to the code, recompiling, migration yada yada yada. All the bad things of configuration management
  • The Publisher pattern - if your XML files are hardly dynamic, you can run a batch process that builds the HTML files( using static/dynamic transformatios ) and keeps them ready on the server. When a client request comes in, you serve the ready made HTML. This approach is the least complicated of all the three and greatly enhances the response time.
    Advantages - Faster response, very little coding required( most of the XSLT engines supports command-line invocations ), easy maintenance.
    Disadvantages - Not flexible at all. Might require additional coding if you decide to automate the HTML generation process.

  • Match your requirements to these strategies and choose the best fitting approach. Don't think of these approaches as mutually exclusive, if need be get creative and derive a hybrid solution
    Cheers!
    ------------------
    Ajith Kallambella M.
    Sun Certified Programmer for the Java�2 Platform.
    IBM Certified Developer - XML and Related Technologies, V1.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!