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 ...

Get XML and Java™ from scratch now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.