Article

Get XSL To Do Your Dirty Work

Page: 1 2 3 4 5

Putting It All Together

Although this article only allowed us to scratch the surface of what XSL is capable of, I hope at least that I've convinced you that it's easier to write an XSL stylesheet to convert your custom-tagged document into a viewable HTML page than it is to write the equivalent script in, say ASP, PHP or Perl.

Eventually all browsers in common use will have built-in support for XSL the way Internet Explorer 6+ and Netscape 6+ do, at which point we can just send the browser an XML file with the XSL stylesheet to display it. For the time being, however, practical applications the XSL processor must be integrated into the server, as shown in Fig. 8.

An XML-Based CMSFig. 8: An XML-Based CMS

If this looks like it might be more complicated to set up than a traditional CMS, where the document formatting is done with custom code, it is. The payoff for this extra setup time more than makes up for it, however:

  • The code is much simpler and more reusable.
  • XSL Templates are easier to maintain.
  • The tag parser is written for you, and is much more robust.
  • XSL parsers give better performance than custom code.

In future articles, we'll delve more deeply into XSL to create more powerful templates and learn how to set up PHP and other server-side languages to use an XSL processor. For now, though, I'll leave you with this list of related resources, which should give you plenty to think about before you design your next CMS.

Further Reading

XSL

Professional XSLProfessional XSL (Wrox Press)

An excellent reference and my personal pick of the XSL books currently available, this book covers not only the core language elements of XSL, but also discusses the XSL-FO, transformations to more esoteric document types such as SVG and VoiceXML, and provides a practical case study of using XSL in a content-management system with ASP. All up, a very thorough and complete guide to the world of XSL.

XSLTXSLT (O'Reilly)

An attractively designed and very readable book that covers everything there is to know about XSL Transformations (XSLT). Unfortunately, this book doesn't go into XSL-FO (which rounds out the XSL standard, but was only just finalized), nor does it cover many of the tools surrounding XSL that Wrox's book looks at. I also found a bothersome number of typographic errors in the code segments of this book, suggesting it was rushed to press perhaps prematurely. That said, I found it slightly easier to learn XSL with this book as the writing style was more clear and concise.

DocBook

A Gentle Guide to DocBook (IBM DeveloperWorks)

"This article explains what DocBook is and how to create a simple document using DocBook. Joe Brockmeier walks you through creating a document and using SGML-tools Lite to parse the document and make HTML, PostScript, plain-text, and PDF versions of the document. He also includes further references on DocBook and tips on where to find SGML-tools lite and other DocBook tools."

DocBook: The Definitive Guide (O'Reilly)

The free, online edition of O'Reilly's book, which serves as the official documentation for the DocBook standard. An older, hardcopy edition of this book is also available in major bookstores.

DocBook XML DTD (The XML Cover Pages)

A site that tracks the latest developments, articles and resources related to the DocBook XML standard.

If you liked this article, share the love:
Print-Friendly Version Suggest an Article

Sponsored Links

Rate This Article

  • 1
    Poor
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
    Great

Comment on This Article

Have something to say?

Post A Comment

You need to be a member of the SitePoint Forums to comment on this post. Sign Up

Already a member? Post using your SitePoint Forums account: