Benefits/Disadvantages of using XSL to render entire web pages

后端 未结 7 1413
星月不相逢
星月不相逢 2021-02-13 22:00

I am in the preliminary stages of planning a project with a client to redo their current website. I took a look at their current site to see what issues they are currently deali

相关标签:
7条回答
  • 2021-02-13 22:13

    I think XSLT is great when built the right way(We use a framework of templates at work).

    0 讨论(0)
  • 2021-02-13 22:14

    XSLT on client side

    • Disables progressive rendering. User won't see anything at all until entire stylesheet and data is loaded completely.
    • Not supported by search engines and other crawlers. They'll see raw XML.
    • Not supported by older/less advanced browsers.

    XSLT in general

    • Unless you carefully design your stylesheets, they may quickly become difficult to maintain:
      • with numerous templates it may be very difficult to figure out which templates are applied.
      • verbosity of XSLT and XML syntax make it hard to understand anything at glance.
      • XPath tricks are tempting, but nightmare to modify later.
    0 讨论(0)
  • 2021-02-13 22:15

    Sounds like the All-singing-all-dancing XML fetish.

    Since you can do anything with XSLT, might as well do everything. I've had people ask why a data warehouse isn't just XSLT transforms between input, data mart and reports.

    Advantage. Everything's in XML.

    Disadvantages.

    • Not very readable. Your page templates are bound up as XSLT transformations with confusing looping and conditional processing features.

    • Any change to page templates requires an XSLT expert, in addition to the graphic designer who created (and debugged) the HTML and CSS.

    0 讨论(0)
  • 2021-02-13 22:15

    Biggest benefit: platform neutral way to render xml

    Biggest disadvantage xsl is difficult to maintain

    I've once had to work with an xsl over 4,000 lines long that also includes several other xsl templates. Now that was hard to work with!

    0 讨论(0)
  • 2021-02-13 22:24

    Sounds like they did it because they knew XSL-T very well and already had XML data on hand.

    I wouldn't like the solution myself. XSL-T isn't the easiest thing to read or write. It doesn't lend itself well to visualizing how a page will look. It cuts designers and web developers out of the process. And it doesn't internationalize well. There's nothing equivalent to Java resource bundles that can pull out locale specific information. I don't consider cut & paste a good solution.

    0 讨论(0)
  • 2021-02-13 22:26

    The answers above provide a good survey of some of the advantages and disadvantages of XSLT. I'd like to add another disadvantage. We have found that you pretty quickly run into scalability issues when using XSLT for moderately large datasets.

    When processing XML files, XSLT must load the entire document into memory. With Xalan, this consumes roughly 10x the size of the input file (saxon has an alternative DOM implementation that uses less memory). If any of your input datasets grow beyond a couple of hundred megabytes, your XSLT processor might just flake out.

    0 讨论(0)
提交回复
热议问题