Torsten Schlabach wrote:
as if would allow for a generic XSLT which for example renders the rowset
into an HTML table.

WDYT?

Not sure I understood you, but, if you want something like:
<table>
        <tr>
                <th>firstname</th>
                <th>lastname</th>
        </tr>
        <tr>
                <td>Schlabach</td>
                <td>Torsten</td>
        </tr>
</table>

You can have it with both XML formats.

It boils down to using "local-name()" instead of "@name" in the relevant XSLT, like:
<xsl:template match="rowset">
        <table>
                <xsl:apply-templates select="*"/>
        </table>
</xsl:template>           
        
<xsl:template match="row">
        <xsl:if test="position()=1">
                <tr>
                        <xsl:for-each select="*">
                         <th><xsl:value-of select="local-name()"/></th>
                        </xsl:for-each>   
                </tr>
        </xsl:if>
        <tr>
                <xsl:for-each select="*">
                        <td><xsl:value-of select="."/></td>
                </xsl:for-each>
        </tr>
</xsl:template>

On the other hand, the format you proposed is cleaner indeed.
        
Regards,

--------------------
   Luca Morandini
www.lucamorandini.it
--------------------

Reply via email to