The following example uses the widgetorders XML document shown earlier, and this XSLT template:

<?xml version="1.0"?>

<xsl:stylesheet xmlns:xsl="" version="1.0">

<xsl:template match="widget-orders">
       <td>Order Id</td>
       <td>Order Status</td>
   <xsl:for-each select="order[@account='86666']">

     <xsl:sort select="@id"/>
         <td> <xsl:value-of select="@id"/> </td>
         <td> <xsl:value-of select="order-status"/> </td>



The example uses the servlet bean XMLTransform as follows:

<dsp:droplet name="/atg/dynamo/droplet/xml/XMLTransform">
     <dsp:param name="input" value="orders.xml"/>
     <dsp:param name="template" value="orders-template.xsl"/>

     <dsp:oparam name="failure">
       Failure to transform XML document: <dsp:valueof param="input"/>

The orders.xml document is transformed by this template to yield the same output as shown in the XMLToDOM example shown earlier (in Processing XML in a JSP). The XSLT template performs the same selection and formatting as the servlet beans XMLToDOM, NodeForEach, and NodeMatch.

loading table of contents...