I don't have a template but wouldn't it just be
<xsl:template match="Purchase-Orders">
<table>
<xsl:apply-templates select="Purchase-Order" />
</table>
</xsl:template>
<xsl:template match="Purchase-Order/*">
<tr><xsl:apply-templates /></tr>
</xsl:template>
<xsl:template match="Purchase-Order">
<xsl:if test="not(preceding-sibling::Purchase-Order)">
<tr>
<xsl:for-each select="./*">
<th><xsl:value-of select="name()" /></th>
</xsl:for-each>
</tr>
</xsl:if>
<tr>
<xsl:apply-templates />
</tr>
</xsl:template>
Though this does assume that each Purchase-Order has all children in it,
in the same order.
HTH,
Ken R.
-----Original Message-----
From: Bovy, Stephen J [mailto:[EMAIL PROTECTED]
Sent: Friday, 3 September 2004 7:41 AM
To: [email protected]
Subject: XSL To Convert XML database 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 ????