23.8. XSLT Example 2: Custom JSP Tag

In this example, a custom JSP tag is used along with XSLT to output a listing of Stout Medal daylilies in an HTML table, formatted specifically for the client's browser type. Netscape 4.7 and earlier do not support the HTML 4.0 elements: THEAD, TBODY, and TFOOT. However, these three elements are supported by Internet Explorer 4.x and later (see Section 2.4, “Tables,” for details on these elements). Thus, in this example, two separate style sheets are used to process the XML file, perennials.xml (Listing 23.4), and depending on which client browser accesses the JavaServer Page, Daylilies.jsp (Listing 23.18), the correct style sheet is applied. The first XSL document, perennials-ie.xsl (Listing 23.16) formats ...

Get Core Web Programming, Second Edition 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.