Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/xml/14.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/xslt/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
XML文件没有关联的样式表_Xml_Xslt - Fatal编程技术网

XML文件没有关联的样式表

XML文件没有关联的样式表,xml,xslt,Xml,Xslt,当我在浏览器中使用.xml运行网页时,它只显示代码和以下语句: 此XML文件似乎没有任何与之关联的样式信息。文档树如下所示 这是我的XML代码: <?xml version="1.0" encoding="ISO-8859-1"?> <?xml-stylesheet type="text/xsl" href=wonders.xsl" ?> <seven_wonders> <wonder> <name>G

当我在浏览器中使用.xml运行网页时,它只显示代码和以下语句:

此XML文件似乎没有任何与之关联的样式信息。文档树如下所示

这是我的XML代码:

<?xml version="1.0" encoding="ISO-8859-1"?>
<?xml-stylesheet type="text/xsl" href=wonders.xsl" ?>

<seven_wonders>
    <wonder>    
        <name>Great Pyramid Of Giza</name>
        <location>Giza Necropolis, Egypt</location>
        <builder>Egyptians</builder>
        <constructed>2584-2561 BC</constructed>
    </wonder>
    <wonder>    
        <name>Hanging Gardens of Babylon</name>
        <location>Hillah, Babylon Province, Iraq or Nineveh, Nineveh Province, Iraq</location>
        <builder>Babylonians</builder>
        <constructed>c. 600 BC</constructed>
    </wonder>
    <wonder>    
        <name>Temple of Artemis at Ephesus</name>
        <location>Selcuk, Izmir Province, Turkey</location>
        <builder>Lydians, Greeks</builder>
        <constructed>c. 550 BC</constructed>
    </wonder>
    <wonder>    
        <name>Statue of Zeus at Olympia</name>
        <location>Olympia, Greece</location>
        <builder>Greeks</builder>
        <constructed>466-435 BC</constructed>
    </wonder>
    <wonder>    
        <name>Mausoleum at Halicarnassus</name>
        <location>Bodrum, Turkey</location>
        <builder>Carians, Greeks</builder>
        <constructed>351 BC</constructed>
    </wonder>
    <wonder>    
        <name>Colossus of Rhodes</name>
        <location>Rhodes, Greece</location>
        <builder>Greeks</builder>
        <constructed>292-280 BC</constructed>
    </wonder>
    <wonder>    
        <name>Lighthouse of Alexandria</name>
        <location>Alexandria, Egypt</location>
        <builder>Ptolemaic Egypt, Greeks</builder>
        <constructed>c. 280 BC</constructed>
    </wonder>                       
</seven_wonders>                                


以下是错误,修复后,文档加载和转换很好:

<xsl:output method="html" encoding="ISO-8859-1" indent="yes" standalone="yes" />

您需要
method=“html”
,否则IE会认为这是XML并相应地格式化它


,但在其他方面你做得很好。

下面是错误,修复后,文档加载和转换很好:

<xsl:output method="html" encoding="ISO-8859-1" indent="yes" standalone="yes" />

您需要
method=“html”
,否则IE会认为这是XML并相应地格式化它


,但在其他方面你做得对。

你在等号后面缺少了一个双引号:
href=“
你在等号后面缺少了一个双引号:
href=“