Hi Stephen,
First of all, your XML was not well-formed, it missed one '>' in the
document node. Guess it must have been a typo.
Then, you must mean a xsl stylesheet as a template I suppose? Then this
might help you:
<?xml version="1.0" encoding="iso-8859-1"?>
<xsl:stylesheet
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
version="1.0">
<xsl:output indent="yes"/>
<xsl:template match="/Purchase-Orders">
<table border="1">
<xsl:apply-templates select="Purchase-Order"/>
</table>
</xsl:template>
<xsl:template match="Purchase-Order">
<th>
<xsl:value-of select="name" />
</th>
<tr>
<xsl:apply-templates select="@*|node()"/>
</tr>
</xsl:template>
<xsl:template match="@*|node()">
<td>
<xsl:value-of select="." />
</td>
</xsl:template>
<xsl:template match="name"/>
</xsl:stylesheet>
Cheers,
</prs>
-----Original Message-----
From: Bovy, Stephen J [mailto:STEPHEN(_dot_)Bovy(_at_)ca(_dot_)com]
Sent: Thursday, September 02, 2004 4:19 PM
To: xsl-list(_at_)lists(_dot_)mulberrytech(_dot_)com
Subject: [xsl] xsl template for simple data-base to transform into html
displayable table
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
????
--+------------------------------------------------------------------
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--+--