RE: [xsl] XSL transform to HTML when element names are unknown

Subject: RE: [xsl] XSL transform to HTML when element names are unknown
From: "Tusler, Dylan" <tuslerd@xxxxxxxxxxxxxxxxxxx>
Date: Thu, 5 Jan 2006 10:12:21 +1000
That's pretty much it.

A bit of slipping and sliding, and I've got the column headings on too.

Thanks for you assistance.

Dylan.




How about:

<xsl:stylesheet version="1.0"
 xmlns:xsl="http://www.w3.org/1999/XSL/Transform";>

<xsl:key name="tableData" match="Tables/*" use="local-name()"/>

<xsl:template match="/">
	<body>
		<xsl:apply-templates select="/Tables/*[generate-id() =
generate-id(key('tableData', local-name())[1])]"/>
	</body>
</xsl:template>

<xsl:template match="*">
	<table>
		<xsl:apply-templates select="key('tableData', local-name())"
mode="content"/>
	</table>
</xsl:template>

<xsl:template match="*" mode="content">
	<tr>
		<xsl:for-each select="*">
			<td><xsl:value-of select="."/></td>
		</xsl:for-each>
	</tr>
</xsl:template>

</xsl:stylesheet>


=======================================================
The contents of this message may express views and opinions not necessarily
shared by Maroochy Shire Council. This email and any files transmitted with it
are intended solely for the use of the individual or entity to whom they are
addressed.
Maroochy Shire Council is a government organisation and is subject to Freedom
of Information legislation. You must assume that any material sent to Maroochy
Shire Council may be monitored and may be accessible by persons other than the
intended recipient.
=======================================================
Note: Maroochy Shire Council does not accept multimedia or vulnerable file
types such as executables, html or GIF files via email.
Emails must be in English and under 10MB.
mscmail5.1

Current Thread