0

Attribute match is not allowed on this element除了根,我在所有这些元素 XAML 上都遇到错误。我想我错过了一些关于语法的东西......

<?xml version="1.0" encoding="UTF-8"?>
    <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
       <xsl:output omit-xml-declaration="yes" indent="yes" />
       <xsl:strip-space elements="*" />
               <xsl:output method="html"/>
        <xsl:template match="/">  
            <html>
                <body>
                   <xsl:apply-templates match="/Table"/>
                    <xsl:apply-templates match="/Paragraph"/>
                    </body>
            </html>
            </xsl:template>

            <xsl:template match="Table">
                <table>
                    <xsl:apply-templates match="TableRowGroup"/>
                </table>
            </xsl:template>


            <xsl:template match="TableRowGroup">
                    <xsl:apply-templates match="TableRow"/>
            </xsl:template>


            <xsl:template match="TableRow">
                <tr>
                    <xsl:apply-templates match="TableCell"/>
                </tr>
            </xsl:template>


            <xsl:template match="TableCell">
                <td>
                </td>
            </xsl:template>

            </xsl:stylesheet>
4

1 回答 1

1

使用<xsl:apply-templates select="..."/>而不是<xsl:apply-templates match="..."/>.

于 2013-11-12T15:05:44.913 回答