ilene 2003/02/20 10:43:14
Added: java/samples/servlet booklist1.xsl birds.xml birds.xsl
web.xml catalog.xml booklist2.xsl
Log:
Committing Christine Li's ([EMAIL PROTECTED]) patch to the servlet sample.
Bugzilla #17136
Revision Changes Path
1.1 xml-xalan/java/samples/servlet/booklist1.xsl
Index: booklist1.xsl
===================================================================
<?xml version="1.0"?>
<!-- 5630-A23, 5630-A22, (C) Copyright IBM Corporation, 1997, 2000 -->
<!-- All rights reserved. Licensed Materials Property of IBM -->
<!-- Note to US Government users: Documentation related to restricted rights
-->
<!-- Use, duplication or disclosure is subject to restrictions set forth in
GSA ADP Schedule with IBM Corp. -->
<!-- This page may contain other proprietary notices and copyright
information, the terms of which must be observed and followed. -->
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns="http://www.w3.org/TR/REC-html40">
<xsl:output method="html" indent="no"/>
<!--begin template rule-->
<!--pattern-->
<xsl:template match="/">
<!--action-->
<HEAD font-size="24pt" color="red">
<h1>
<p>Books Checked Out</p>
</h1>
</HEAD>
<BODY>
<xsl:apply-templates/>
</BODY>
</xsl:template>
<xsl:template match="BOOK">
<p>
<xsl:value-of select="TITLE"/>
</p>
</xsl:template>
<!--end template rule-->
</xsl:stylesheet>
1.1 xml-xalan/java/samples/servlet/birds.xml
Index: birds.xml
===================================================================
<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" href="birds.xsl"?>
<Class>
<Order Name="TINAMIFORMES">
<Family Name="TINAMIDAE">
<Species Scientific_Name="Tinamus major"> Great
Tinamou.</Species>
<Species Scientific_Name="Nothocercus">Highland Tinamou.</Species>
<Species Scientific_Name="Crypturellus soui">Little
Tinamou.</Species>
<Species Scientific_Name="Crypturellus cinnamomeus">Thicket
Tinamou.</Species>
<Species Scientific_Name="Crypturellus boucardi">Slaty-breasted
Tinamou.</Species>
<Species Scientific_Name="Crypturellus kerriae">Choco
Tinamou.</Species>
</Family>
</Order>
<Order Name="GAVIIFORMES">
<Family Name="GAVIIDAE">
<Species Scientific_Name="Gavia stellata">Red-throated
Loon.</Species>
<Species Scientific_Name="Gavia arctica">Arctic Loon.</Species>
<Species Scientific_Name="Gavia pacifica">Pacific Loon.</Species>
<Species Scientific_Name="Gavia immer">Common Loon.</Species>
<Species Scientific_Name="Gavia adamsii">Yellow-billed
Loon.</Species>
</Family>
</Order>
<Order Name="PODICIPEDIFORMES">
<Family Name="PODICIPEDIDAE">
<Species Scientific_Name="Tachybaptus dominicus">Least
Grebe.</Species>
<Species Scientific_Name="Podilymbus podiceps">Pied-billed
Grebe.</Species>
<Species Scientific_Name="">Atitlan Grebe.</Species>
<Species Scientific_Name="">Horned Grebe.</Species>
<Species Scientific_Name="">Red-necked Grebe.</Species>
<Species Scientific_Name="">Eared Grebe.</Species>
<Species Scientific_Name="">Western Grebe.</Species>
<Species Scientific_Name="">Clark's Grebe.</Species>
<Species Scientific_Name=""/>
</Family>
</Order>
<Order Name="PROCELLARIIFORMES">
<Family Name="DIOMEDEIDAE">
<Species Scientific_Name="Thalassarche
chlororhynchos">Yellow-nosed Albatross. (A)</Species>
<Species Scientific_Name="Thalassarche cauta">Shy Albatross.
(A)</Species>
<Species Scientific_Name="Thalassarche melanophris">Black-browed
Albatross. (A)</Species>
<Species Scientific_Name="Phoebetria palpebrata">Light-mantled
Albatross. (A)</Species>
<Species Scientific_Name="Diomedea exulans">Wandering Albatross.
(A)</Species>
<Species Scientific_Name="Phoebastria immutabilis">Laysan
Albatross.</Species>
<Species Scientific_Name="Phoebastria nigripes">Black-footed
Albatross.</Species>
<Species Scientific_Name="Phoebastria albatrus">Short-tailed
Albatross. (N)</Species>
</Family>
<Family Name="PROCELLARIIDAE">
<Species Scientific_Name="Fulmarus glacialis">Northern
Fulmar.</Species>
<Species Scientific_Name="Pterodroma neglecta">Kermadec Petrel.
(A)</Species>
<Species Scientific_Name="Pterodroma arminjoniana">Herald Petrel.
(A)</Species>
<Species Scientific_Name="Pterodroma ultima">Murphy's Petrel.
(N)</Species>
<Species Scientific_Name="Pterodroma inexpectata">Mottled Petrel.
(A)</Species>
<Species Scientific_Name="Pterodroma cahow">Bermuda
Petrel.</Species>
<Species Scientific_Name="Pterodroma hasitata">Black-capped
Petrel.</Species>
<Species Scientific_Name="Pterodroma externa">Juan Fernandez
Petrel. (N)</Species>
<Species Scientific_Name="Pterodroma phaeopygia">Dark-rumped
Petrel.</Species>
<Species Scientific_Name="Pterodroma cervicalis">White-necked
Petrel. (H)</Species>
<Species Scientific_Name="Pterodroma hypoleuca">Bonin Petrel.
(H)</Species>
<Species Scientific_Name="Pterodroma nigripennis">Black-winged
Petrel. (H, A)</Species>
<Species Scientific_Name="Pterodroma cookii">Cook's Petrel.
(N)</Species>
<Species Scientific_Name="Pterodroma longirostris">Stejneger's
Petrel. (A)</Species>
<Species Scientific_Name="Bulweria bulwerii">Bulwer's Petrel.
(H)</Species>
<Species Scientific_Name="Bulweria fallax">Jouanin's Petrel. (H,
A)</Species>
<Species Scientific_Name="Procellaria parkinsoni">Parkinson's
Petrel. (N)</Species>
<Species Scientific_Name="Calonectris leucomelas">Streaked
Shearwater. (A)</Species>
<Species Scientific_Name="Calonectris diomedea">Cory's
Shearwater. (N)</Species>
<Species Scientific_Name="Puffinus creatopus">Pink-footed
Shearwater. (N)</Species>
<Species Scientific_Name="Puffinus carneipes">Flesh-footed
Shearwater. (N)</Species>
<Species Scientific_Name="Puffinus gravis">Greater Shearwater.
(N)</Species>
<Species Scientific_Name="Puffinus pacificus">Wedge-tailed
Shearwater.</Species>
<Species Scientific_Name="Puffinus bulleri">Buller's Shearwater.
(N)</Species>
<Species Scientific_Name="Puffinus griseus">Sooty Shearwater.
(N)</Species>
<Species Scientific_Name="Puffinus tenuirostris">Short-tailed
Shearwater. (N)</Species>
<Species Scientific_Name="Puffinus nativitatis">Christmas
Shearwater. (H)</Species>
<Species Scientific_Name="Puffinus puffinus">Manx
Shearwater.</Species>
<Species Scientific_Name="Puffinus auricularis">Townsend's
Shearwater.</Species>
<Species Scientific_Name="Puffinus opisthomelas">Black-vented
Shearwater.</Species>
<Species Scientific_Name="Puffinus lherminieri">Audubon's
Shearwater.</Species>
<Species Scientific_Name="Puffinus assimilis">Little Shearwater.
(A)</Species>
</Family>
<Family Name="HYDROBATIDAE">
<Species Scientific_Name="Oceanites oceanicus">Wilson's
Storm-Petrel. (N)</Species>
<Species Scientific_Name="Pelagodroma marina">White-faced
Storm-Petrel. (A)</Species>
<Species Scientific_Name="Hydrobates pelagicus">European
Storm-Petrel. (A)</Species>
<Species Scientific_Name="Oceanodroma furcata">Fork-tailed
Storm-Petrel.</Species>
<Species Scientific_Name="Oceanodroma leucorhoa">Leach's
Storm-Petrel.</Species>
<Species Scientific_Name="Oceanodroma homochroa">Ashy
Storm-Petrel.</Species>
<Species Scientific_Name="Oceanodroma castro">Band-rumped
Storm-Petrel. (N)</Species>
<Species Scientific_Name="Oceanodroma tethys">Wedge-rumped
Storm-Petrel. (N)</Species>
<Species Scientific_Name="Oceanodroma melania">Black
Storm-Petrel.</Species>
<Species Scientific_Name="Oceanodroma macrodactyla">Guadalupe
Storm-Petrel.</Species>
<Species Scientific_Name="Oceanodroma markhami">Markham's
Storm-Petrel. (A)</Species>
<Species Scientific_Name="Oceanodroma tristrami">Tristram's
Storm-Petrel. (H)</Species>
<Species Scientific_Name="Oceanodroma microsoma">Least
Storm-Petrel.</Species>
</Family>
</Order>
<Order Name="PELECANIFORMES">
<Family Name="PHAETHONTIDAE">
<Species Scientific_Name="Phaethon lepturus">White-tailed
Tropicbird.</Species>
<Species Scientific_Name="Phaethon aethereus">Red-billed
Tropicbird.</Species>
<Species Scientific_Name="Phaethon rubricauda">Red-tailed
Tropicbird.</Species>
</Family>
<Family Name="SULIDAE">
<Species Scientific_Name="Sula dactylatra">Masked Booby.</Species>
<Species Scientific_Name="Sula nebouxii">Blue-footed
Booby.</Species>
<Species Scientific_Name="Sula variegata">Peruvian Booby.
(A)</Species>
<Species Scientific_Name="Sula leucogaster">Brown Booby.</Species>
<Species Scientific_Name="Sula sula">Red-footed Booby.</Species>
<Species Scientific_Name="Morus bassanus">Northern
Gannet.</Species>
</Family>
<Family Name="PELECANIDAE">
<Species Scientific_Name="Pelecanus erythrorhynchos">American
White Pelican.</Species>
<Species Scientific_Name="Pelecanus occidentalis">Brown
Pelican.</Species>
</Family>
<Family Name="PHALACROCORACIDAE">
<Species Scientific_Name="Phalacrocorax penicillatus">Brandt's
Cormorant.</Species>
<Species Scientific_Name="Phalacrocorax brasilianus">Neotropic
Cormorant.</Species>
<Species Scientific_Name="Phalacrocorax auritus">Double-crested
Cormorant.</Species>
<Species Scientific_Name="Phalacrocorax carbo">Great
Cormorant.</Species>
<Species Scientific_Name="Phalacrocorax urile">Red-faced
Cormorant.</Species>
<Species Scientific_Name="Phalacrocorax pelagicus">Pelagic
Cormorant.</Species>
</Family>
<Family Name="ANHINGIDAE">
<Species Scientific_Name="Anhinga anhinga">Anhinga.</Species>
</Family>
<Family Name="FREGATIDAE">
<Species Scientific_Name="Fregata magnificens">Magnificent
Frigatebird.</Species>
<Species Scientific_Name="Fregata minor">Great
Frigatebird.</Species>
<Species Scientific_Name="Fregata ariel">Lesser Frigatebird.
(A)</Species>
</Family>
</Order>
</Class>
1.1 xml-xalan/java/samples/servlet/birds.xsl
Index: birds.xsl
===================================================================
<?xml version="1.0"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
version="1.0">
<xsl:output method="xml" indent="yes"/>
<xsl:template match="Class">
<BirdInfo>
<xsl:apply-templates select="Order"/>
</BirdInfo>
</xsl:template>
<xsl:template match="Order">
Order is: <xsl:value-of select="@Name"/>
<xsl:apply-templates select="Family"/><xsl:text>
</xsl:text>
</xsl:template>
<xsl:template match="Family">
Family is: <xsl:value-of select="@Name"/>
<xsl:apply-templates select="Species | SubFamily | text()"/>
</xsl:template>
<xsl:template match="SubFamily">
SubFamily is <xsl:value-of select="@Name"/>
<xsl:apply-templates select="Species | text()"/>
</xsl:template>
<xsl:template match="Species">
<xsl:choose>
<xsl:when test="name(..)='SubFamily'">
<xsl:text> </xsl:text><xsl:value-of select="."/><xsl:text>
</xsl:text><xsl:value-of select="@Scientific_Name"/>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="."/><xsl:text> </xsl:text><xsl:value-of
select="@Scientific_Name"/>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
</xsl:stylesheet>
1.1 xml-xalan/java/samples/servlet/web.xml
Index: web.xml
===================================================================
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE web-app PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application
2.2//EN" "http://java.sun.com/j2ee/dtds/web-app_2_2.dtd">
<web-app>
<display-name>xalanservlet</display-name>
<servlet>
<servlet-name>SimpleXSLTServlet</servlet-name>
<display-name>SimpleXSLTServlet</display-name>
<servlet-class>servlet.SimpleXSLTServlet</servlet-class>
</servlet>
<servlet>
<servlet-name>UseStylesheetParamServlet</servlet-name>
<display-name>UseStylesheetParamServlet</display-name>
<servlet-class>servlet.UseStylesheetParamServlet</servlet-class>
</servlet>
<servlet>
<servlet-name>XSLTServletWithParams</servlet-name>
<display-name>XSLTServletWithParams</display-name>
<servlet-class>servlet.XSLTServletWithParams</servlet-class>
</servlet>
<servlet>
<servlet-name>ApplyXSLT</servlet-name>
<display-name>ApplyXSLT</display-name>
<servlet-class>servlet.ApplyXSLT</servlet-class>
<init-param>
<param-name>mediaURL</param-name>
<param-value>media.properties</param-value>
</init-param>
<init-param>
<param-name>xslURL</param-name>
<param-value>/xalanservlet/booklist1.xsl</param-value>
</init-param>
</servlet>
<servlet-mapping>
<servlet-name>SimpleXSLTServlet</servlet-name>
<url-pattern>/SimpleXSLTServlet</url-pattern>
</servlet-mapping>
<servlet-mapping>
<servlet-name>UseStylesheetParamServlet</servlet-name>
<url-pattern>/UseStylesheetParamServlet</url-pattern>
</servlet-mapping>
<servlet-mapping>
<servlet-name>XSLTServletWithParams</servlet-name>
<url-pattern>/XSLTServletWithParams</url-pattern>
</servlet-mapping>
<servlet-mapping>
<servlet-name>ApplyXSLT</servlet-name>
<url-pattern>/ApplyXSLT/*</url-pattern>
</servlet-mapping>
</web-app>
1.1 xml-xalan/java/samples/servlet/catalog.xml
Index: catalog.xml
===================================================================
<?xml version="1.0"?>
<!-- 5630-A23, 5630-A22, (C) Copyright IBM Corporation, 1997, 2000 -->
<!-- All rights reserved. Licensed Materials Property of IBM -->
<!-- Note to US Government users: Documentation related to restricted rights
-->
<!-- Use, duplication or disclosure is subject to restrictions set forth in
GSA ADP Schedule with IBM Corp. -->
<!-- This page may contain other proprietary notices and copyright
information, the terms of which must be observed and followed. -->
<CATALOG>
<BOOK>
<TITLE>A Certain Justice</TITLE>
<AUTHOR>P.D. James</AUTHOR>
<YEAR-PUBLISHED>1998</YEAR-PUBLISHED>
<ISBN>0375401091</ISBN>
</BOOK>
<BOOK>
<TITLE>Ashworth Hall</TITLE>
<AUTHOR>Anne Perry</AUTHOR>
<YEAR-PUBLISHED>1997</YEAR-PUBLISHED>
<ISBN>0449908445</ISBN>
</BOOK>
<BOOK>
<TITLE>L.A. Confidential</TITLE>
<AUTHOR>James Ellroy</AUTHOR>
<YEAR-PUBLISHED>1997</YEAR-PUBLISHED> <ISBN>0446674249</ISBN>
</BOOK>
<BOOK>
<TITLE>Shadow Woman</TITLE>
<AUTHOR>Thomas Perry</AUTHOR>
<YEAR-PUBLISHED>1997</YEAR-PUBLISHED>
<ISBN>0679453024</ISBN>
</BOOK>
</CATALOG>
1.1 xml-xalan/java/samples/servlet/booklist2.xsl
Index: booklist2.xsl
===================================================================
<?xml version="1.0"?>
<!-- 5630-A23, 5630-A22, (C) Copyright IBM Corporation, 1997, 2000 -->
<!-- All rights reserved. Licensed Materials Property of IBM -->
<!-- Note to US Government users: Documentation related to restricted rights
-->
<!-- Use, duplication or disclosure is subject to restrictions set forth in
GSA ADP Schedule with IBM Corp. -->
<!-- This page may contain other proprietary notices and copyright
information, the terms of which must be observed and followed. -->
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns="http://www.w3.org/TR/REC-html40">
<xsl:output method="html" indent="no"/>
<xsl:template match="/">
<html>
<head>
<meta name="GENERATOR" content="Mozilla/4.73 [en] (Windows NT 5.0; U)
[Netscape]"></meta>
</head>
<body>
<table BORDER="0" CELLSPACING="0" CELLPADDING="0" COLS="4" WIDTH="100%" >
<caption><b><font face="Arial,Helvetica"><font size="-1">My
Books</font></font></b></caption>
<tr>
<td ALIGN="CENTER" WIDTH="75" BGCOLOR="#666666"><b><font
face="Arial,Helvetica"><font color="#FFFFFF"><font
size="-2">ISBN</font></font></font></b></td>
<td ALIGN="CENTER" WIDTH="250" BGCOLOR="#666666"><b><font
face="Arial,Helvetica"><font color="#FFFFFF"><font
size="-2">Title</font></font></font></b></td>
<td ALIGN="CENTER" BGCOLOR="#666666"><b><font
face="Arial,Helvetica"><font color="#FFFFFF"><font
size="-2">Author</font></font></font></b></td>
<td ALIGN="CENTER" BGCOLOR="#666666"><b><font
face="Arial,Helvetica"><font color="#FFFFFF"><font
size="-2">Published</font></font></font></b></td>
</tr>
<xsl:apply-templates/>
</table>
</body>
</html>
</xsl:template>
<xsl:template match="BOOK">
<tr>
<td BGCOLOR="#CCCCCC"><font face="Arial,Helvetica"><font size="-1">
<xsl:value-of select="ISBN"/> </font></font></td>
<td BGCOLOR="#EBEBEB"><font face="Arial,Helvetica"><font size="-1">
<xsl:value-of select="TITLE"/> </font></font></td>
<td BGCOLOR="#CCCCCC"><font face="Arial,Helvetica"><font size="-1">
<xsl:value-of select="AUTHOR"/> </font></font></td>
<td ALIGN="left" BGCOLOR="#EBEBEB"><font face="Arial,Helvetica"><font
size="-1"> <xsl:value-of select="YEAR-PUBLISHED"/> </font></font></td>
</tr>
</xsl:template>
</xsl:stylesheet>
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]