Win a copy of Programmer's Guide to Java SE 8 Oracle Certified Associate (OCA) this week in the OCAJP forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Transforming XML with XSL

 
ajronald
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am using JSP for converting the result set to an XML file...but can any one tell me how to include an xsl style sheet to carryout the transformation, both on the Server and the Client?
 
Ajith Kallambella
Sheriff
Posts: 5782
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Server side transformation is the best way to generate the renderable format. Simply apply the stylesheet to your XML on the server and return the resulting HTML( or any other format of your choice ) to the client.
This way the client gets only the HTML, completely oblivious to how the HTML was generated. Moreover, you don't have to rely on the browser to do the transformation for you. I have seen some implementations where the client gets the XML document that has a reference to the stylesheet. Depending on a browser's capability to transform XML is a big no! no!
Hope that helps,
------------------
Ajith Kallambella M.
Sun Certified Programmer for the Java�2 Platform.
IBM Certified Developer - XML and Related Technologies, V1.
 
Ajith Kallambella
Sheriff
Posts: 5782
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Your name "ajronald" does not comply with the JavaRanch naming policy. Please choose one that meets the requirements.
Without a proper name you will not qualify for the giveaway.
Thanks!
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic