xsl-list
[Top] [All Lists]

RE: XSL transform to HTML when element names are unknown

2006-01-04 17:12:21
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


--~------------------------------------------------------------------
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>
--~--



<Prev in Thread] Current Thread [Next in Thread>