<xsl:call-template name="h2"/> <hr></hr>

<xsl:call-template name="table"/> </body>

</xsl:template>

<!-- Newly-defined element template --> <xsl:template name="h2">

<h2>

<CENTER>

<xsl:value-of select="pl:Flight/@flightNo"/> </CENTER>

</h2>

</xsl:template>

<!-- Composed element template --> <xsl:template match="pl:Customer">

<tr>

<td>

<xsl:value-of select="pl:name/text()"/> </td>

<td>

<xsl:value-of select="pl:membership/text()"/> </td>

</tr>

</xsl:template>

<!-- Newly-defined element template --> <xsl:template name="table">

<table>

<xsl:apply-templates select="pl:Flight/pl:Customer"/> </table>

</xsl:template>

<!-- Identity transformation template -->

<xsl:template match="*@*comment()processing-instruction()text()"> <xsl:copy>

<xsl:apply-templates select="*@*comment()processing-instruction()text()"/>

</xsl:copy>

</xsl:template>

</xsl:stylesheet>

Creating HTML input form

In order to let the user enter a search key, we are going to design a HTML form and a servlet. This servlet is going to call a xsl processor using jaxp. For an example of an input form, see Figure 9-22.

Chapter 9. Developing XML Web services 211

Page 227
Image 227
IBM Version 5 manual Creating Html input form, Center