• Post Reply Bookmark Topic Watch Topic
  • New Topic

XML and XSLT with JSP  RSS feed

 
HS Thomas
Ranch Hand
Posts: 3404
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Why would anyone want to integrate XML and XSLT with JSP ?
Any applications would be useful to know.
 
Frank Carver
Sheriff
Posts: 6920
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
There is a style of web application design which uses JSP to generate XML (or at least XHTML) which is then styled to suit the client or user preferences. This styling can either be done on the server (using a filter, for example), or on the client by providing a stylesheet to the browser.
 
HS Thomas
Ranch Hand
Posts: 3404
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Frank Carver:
to suit the client or user preferences.

Would it be useful for generating content in different languages depending on the country ?
Or is there a better way to do this ?
regards
 
Jeroen Wenting
Ranch Hand
Posts: 5093
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by HS Thomas:

Would it be useful for generating content in different languages depending on the country ?
Or is there a better way to do this ?
regards

You'd better use ResourceBundles for that.
You might use a combination, taking the JSP to generate XML (though I prefer servlets for that) and reading the XSL to be used from a ResourceBundle (which can exist for each supported language).
You'd need to write the XSL sheets for each separate language though which is not good as XSL sheets contain logic and therefore you seriously increase the risk of things getting out of sync.
Better would be to have the generated XML contain the language specific data (retrieved from ResourceBundles or a database) and have a single XSL sheet parse it all (or maybe have 2, one for LtR and one for RtL languages as required).
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!