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 the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.