[XML-DEV Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

Re: JSP or XSL?

jsp svg
3/7/2002 4:53:17 AM, "Christer Nordvik" <christer.nordvik@t...> wrote:

>I have an XML document that I want to output as SVG. Is it better to use
>XSL/XSLT than to use JSP/JavaBeans to generate the final document. The
>XML document contains tags that I don't want in the final document like
>"<rowset>" so I have to just include parts of it. 

Oh goodie, another religious war! <grin>  Has the declarative  vs
procedural controversy been aired here recently?

I doubt if one is unambiguously "better" than the other approach.
It really comes down to what tools you have available (and your level 
of comfort with the tools) that are appropriate to a given problem.
I'd hazard a guess that since SVG has a DOM API, and since you can more easily 
call a 3rd party DOM implementation from JSP/JavaBeans than from XSLT, 
that might be the better way for you. XSLT would almost certainly
make you deal with the SVG at the syntax level rather than the SVG DOM
level, but if you're comfortable with XSLT and SVG syntax, go for it! 
Also, it depends if you need to transform the input data much before
stuffing it in the SVG output.  If you need to look things up in external
databases, do some math on the data, or some other non-trivial manipulation,
JSP/Beans might be more convenient and portable than the equivalent 
XSLT solution.

JSP seems to me like roughly the same design pattern as XSLT: you 
start with a template and fill in the empty spaces by with some code
(procedural in JSP, declarative in XSLT).  XSLT natively understands
XML and XPath patterns, so is very handy for pulling XML out of an
input document and stuffing it into the empty spaces.  On the other hand,
most decent DOM implementations "embrace and extend" the standard to 
support XPath, so you can do that same thing in JSP too.

I would be very interested in seeing a few non-trivial problems of this
sort being addressed both ways, with the solutions shared/critiqued,
so that we can all get a better handle on the guidelines for when a
JSP (or ASP, or PHP, or "DOM code filling in an XML template") approach is
more effective, and when a pure XSLT approach is more effective.
Has anyone done something like this before?


  • References:
    • JSP or XSL?
      • From: "Christer Nordvik" <christer.nordvik@t...>


Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
First Name
Last Name
Subscribe in XML format
RSS 2.0
Atom 0.3

Stylus Studio has published XML-DEV in RSS and ATOM formats, enabling users to easily subcribe to the list from their preferred news reader application.

Stylus Studio Sponsored Links are added links designed to provide related and additional information to the visitors of this website. they were not included by the author in the initial post. To view the content without the Sponsor Links please click here.

Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.