Announcement Announcement Module
Collapse
No announcement yet.
XSLT error and general design question Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • XSLT error and general design question

    Hi,
    I have data stored in XML files that I want to display nicely formatted in the browser so XSLT seemed like the obvious choice to convert the XML to HTML. All the other pages on the site are written in JSP making heavy use of the <spring:message /> tag for field labels. My problem now is that I don't know how to make use of the Spring message resource facility in order to create the labels in the generated HTML. As far as I'm aware, this is not possible using XSLT. This question probably has more to do with XSLT than it does with Spring so my apologies if I'm posting in the wrong place.

    My next question is more of a design issue and definitely not specific to Spring but if anyone would care to indulge me that would be great. My original plan was to perform the transformation when the XML file is uploaded to the site and then store the generated HTML files in a location accessible to the web server. I figured this would improve performance by getting rid of the need to perform the transformation every time the page is requested. The reference documentation provides an example of performing the transformation at view resolution time, meaning a transformation for each page request. Is this a better approach to XML to HTML conversion or should I stick with my intended design? Or should I go with my other option of using an XML processing tag library such as Xtags in order to parse and display the XML? This would get around the problem I'm having of performing message resource lookups.

    Any help is greatly appreciated.
    Cheers,
    Kevin

  • #2
    Originally posted by kevinstembridge
    My problem now is that I don't know how to make use of the Spring message resource facility in order to create the labels in the generated HTML. As far as I'm aware, this is not possible using XSLT.
    Hi Kevin. You're right, it's not (natively). You can work around it, but there's nothing in Spring currently that will offer much assistance in doing so.

    Originally posted by kevinstembridge
    My original plan was to perform the transformation when the XML file is uploaded to the site and then store the generated HTML files in a location accessible to the web server. I figured this would improve performance by getting rid of the need to perform the transformation every time the page is requested.
    Without doubt, it will improve performance if your pages don't rely on request specific data and definitely the way to go if your site will get hit hard.

    Originally posted by kevinstembridge
    Or should I go with my other option of using an XML processing tag library such as Xtags in order to parse and display the XML? This would get around the problem I'm having of performing message resource lookups.
    You might also want to look at something like Cocoon (I've never used it, so it may not answer your problem, but it's a fairly mature XML publishing framework with full i18n support).

    Regards,

    Comment


    • #3
      Thanks for the advice Darren. I'll have a look at Cocoon to see if I can use message resources when I do an XSLT transformation. At the moment though, it looks as though I'm going to have to parse the XML every time the page is requested.

      Thanks again.
      Kevin

      Comment

      Working...
      X