Sqlserver
 sql >> Base de Dados >  >> RDS >> Sqlserver

Como criar planilhas de trabalho dinamicamente usando XSLT?


Aproximadamente:
<xsl:stylesheet version="1.0" 
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:output method="xml" version="1.0" encoding="UTF-8" indent="yes"/>

<xsl:template match="/NewDataset">
    <Workbook>
        <xsl:for-each select="*[starts-with(name(), 'Table')]">
            <Worksheet>
                <xsl:for-each select="record">
                    <Row>
                        <xsl:for-each select="*">
                            <Cell>
                                <xsl:value-of select="." />
                            </Cell>
                        </xsl:for-each>
                    </Row>
                </xsl:for-each>
            </Worksheet>
        </xsl:for-each>
    </Workbook>
</xsl:template>

</xsl:stylesheet>