Re: [xsl] xsl template for simple data-base to transform into html displayable table

Subject: Re: [xsl] xsl template for simple data-base to transform into html displayable table
From: Brandon Schenz <brandons@xxxxxxxxxxxxxxxxx>
Date: Thu, 02 Sep 2004 17:59:34 -0400
How would you like it to display?

<?xml version="1.0" encoding="UTF-8" ?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform";>
<xsl:output method="html" indent="yes" />
<xsl:template match="/">
<html>
<body>
<table>
<tr>
<th>Name</th>
<th>Address</th>
<th>Phone Number</th>
<th>Part Number</th>
<th>Quantity</th>
<th>Price</th>
<th>Total</th>
<tr>
<xsl:apply-templates />
</table>
</body>
</html>
</xsl:template>


   <xsl:template match="Purchase-Order">
         <tr>
            <td><xsl:value-of select="name" /></td>
            <td><xsl:value-of select="address" /></td>
            <td><xsl:value-of select="phone-number" /></td>
            <td><xsl:value-of select="part-number" /></td>
            <td><xsl:value-of select="quantity" /></td>
            <td><xsl:value-of select="price" /></td>
            <td><xsl:value-of select="total" /></td>
         </tr>
   </xsl:template>
</xsl:stylesheet>

Bovy, Stephen J wrote:

I would like to find a simple xml template to convert
something like this:

<Purchase-Orders

<Purchase-Order> <name>Steve Bovy</name> <address>9301 Pali Ave</address> <phone-number>818-352-9917</phone-number> <part-number> 1234</part-number> <quantity>-1</quantity> <price>-15.41</price> <total>-45.32</total> </Purchase-Order>

<Purchase-Order> <name>John Doe</name> <address>Never Land</address> <phone-number>818-999-9999</phone-number> <part-number> 3241</part-number> <quantity> 20</quantity> <price> 15.41</price> <total> 45.32</total> </Purchase-Order> </Purchase-Orders>


Into a Displayable HTML "table"


Has anyone written somehting like this, or can point me to such a template ????

Current Thread