O'Reilly logo

Special Edition Using XSLT by Michael Floyd

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Practical Considerations

Because a style sheet is simply a valid document, you can easily load one into a DOM parser. What’s more, you can create a DOM and write it out to a file just as you would with any other XML document.

The easiest way to do this—and the way that works with the widest range of parsers—is to load a skeletal XSLT document into the DOM. Then you can alter the DOM to suit your needs. Of course, you can generate the document based on the data, but you can also modify the styles based on other criteria such as user preference, the current date, or any other variable you can incorporate into your script or program.

Consider Listing 11.1, which shows a simple XML document that contains a magazine article. You can see that there ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required