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

Media

Now that we know what group our browser is in, what good does it do us?

Fortunately, the authors of the XSLT specification had this very idea in mind, and created a way for us to easily designate different style sheets for different browsers.

Back in Chapter 2, “Product Pages: Transforming XML in the Browser Using XSL,” we created our first XML file, products.xml, and associated it with a style sheet, catalog.xsl. That association looked like Listing 9.5.

Listing 9.5. products.xml: Associating a Style Sheet
0:<?xml version="1.0" encoding="UTF-8"?>
1:<?xml-stylesheet href="catalog.xsl" type="text/xsl"?>
2:
3:<products>
4:    <vendor webvendor="full">
5:        <vendor_name>Conners Chair</vendor_name>
...

We later used the style sheet allproducts.xsl ...

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