Win a copy of Beginning Java 17 Fundamentals: Object-Oriented Programming in Java 17 this week in the Java in General forum!
  • 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 ...
  • Tim Cooke
  • Campbell Ritchie
  • Ron McLeod
  • Liutauras Vilda
  • Jeanne Boyarsky
  • Junilu Lacar
  • Rob Spoor
  • Paul Clapham
Saloon Keepers:
  • Tim Holloway
  • Tim Moores
  • Jesse Silverman
  • Stephan van Hulst
  • Carey Brown
  • Al Hobbs
  • Piet Souris
  • Frits Walraven

IBM XML Parser to generate HTML output

Ranch Hand
Posts: 96
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
Posts: 5782
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Ajith Kallambella M.
    Sun Certified Programmer for the Java�2 Platform.
    IBM Certified Developer - XML and Related Technologies, V1.
Don't get me started about those stupid light bulbs.
    Bookmark Topic Watch Topic
  • New Topic