O'Reilly logo

XML and Java™ from scratch by Nicholas Chase

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

Advanced XSLT: Includes and Imports

What we've done here is useful for one file, but we can make it even more useful. The top part of the file, including any header graphics and the links to other sections of the site, really belong on every page of the site. What would be helpful is the capability to take that information and separate it out into a page that we can use in many different places.

Includes

One way that XSLT provides for us to do that is by allowing us to include one style sheet within another. All we need to do is separate out our reusable information into a style sheet of its own and then call it from whatever page we want. The actual reusable style sheet looks like Listing 4.3.

Listing 4.3. topinclude.xsl: Our Reusable Style ...

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