Why would I want to use JSP when I could use XML/XSL and a parser instead to achieve system independent results?

Software Framework

Use JSP if:
You have Java objects you want to translate to an XML/HTML document and if you don't need the structure of the document to change dynamically. JSP is faster because parsing XML documents can be expensive (cpu and memory).

Use XSL if:
You have data already in XML/HTML format and you don't have to change its content dynamically. You use XSL to allow major changes to the structure of the document; ie you have to move items around, remove items, and add items. You use XSL if the rules for translations are very dynamic and need to be very flexible. You use XSL if the transactions that require it are relatively rare. My tests using xerces and xalan show that they are 10X slower than using a JSP. (This is mostly because parsing XML is relative slow and produces lots of short lived objects.)

I use JSPs to generate the content in a form that I think will be acceptable. I allow xslt translations to handle the cases I didn't think of in advance. It allows the users to make the final decission. The translations created by users are private and I don't write or maintain them. (I do allow users to share their translations with each other).

0 Comments  (click to add your comment)
Comment and Contribute

 

 

 

 

 


(Maximum characters: 1200). You have 1200 characters left.

 

 

About | Sitemap | Contact