无法显示xml页面

时间:2014-11-11 04:34:08

标签: xml internet-explorer xslt

的xml:

<?xml version="1.0" encoding="utf-8"?>
<?xml-stylesheet type="text/xsl" href="pr7.xsl"?>

<patients>
    <patient1>
        <name>
            <fname>Kakar</fname>
            <lname>Nyori</lname>
        </name>
        <age>20</age>
        <ssn>20202</ssn>
        <room>101</room>
        <id>2929</id>
        <groupno>22</groupno>
        <address>Mathikere</address>
    </patient1>
</patients>

的xsl:

<?xml version="1.0" encoding="ISO-8859-1"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
    <xsl:template match="/">
        <html>
            <body>
                <h2>Patient Information</h2>
                <table>
                    <tr>
                        <th>Name</th>
                        <th>Age</th>
                        <th>ssn</th>
                        <th>room</th>
                        <th>id</th>
                        <th>groupno</th>
                        <th>address</th>
                    </tr>
                    <tr>
                        <td><xsl:value-of select="patients/patient1/name"/></td>
                        <td><xsl:value-of select="patients/patient1/age"/></td>
                        <td><xsl:value-of select="patients/patient1/ssn"/></td>
                        <td><xsl:value-of select="patients/patient1/room"/></td>
                        <td><xsl:value-of select="patients/patient1/id"/></td>
                        <td><xsl:value-of select="patients/patient1/groupno"/></td>
                        <td><xsl:value-of select="patients/patient1/address"/></td>
                    </tr>
                </table>
            </body>
        </html>
    </xsl:template>
</xsl:stylesheet>

如果我在chrome中查看它,它不会抛出任何错误。但是在互联网浏览器中它会抛出这个错误:

Cannot view XML input using XSL style sheet. Please correct the error and then click the Refresh button, or try again later. 


--------------------------------------------------------------------------------

The namespace prefix is not allowed to start with the reserved string "xml". Error processing resource 'file:///C:/Users/ad...

 <xml:template match="/patients">

我做错了什么?请帮我解决这个问题。如果你能帮助我,我将非常感激。谢谢。

0 个答案:

没有答案