gpt4 book ai didi

XML 解析错误 : junk after document element

转载 作者:数据小太阳 更新时间:2023-10-29 02:09:45 27 4
gpt4 key购买 nike

当我尝试查看动态生成的 (PHP) XML 文档时出现此错误:

XML 解析错误:文档元素后出现垃圾地址:http://dev.leisurepublishing.com/vtc/master.xml.php第 17 行,第 1 列:^

我用谷歌搜索并查看了文档,但我无法弄清楚哪里出了问题,有人可以帮我找出问题所在吗?

<?php

header("Content-type: text/xml");
require_once("admin/assets/db_connect.php");

echo "<?xml version=\"1.0\" encoding=\"utf-8\"?>"
?>

<master>

<categories>
<category>
<gsm>GFoo</gsm>
<category_id>1</category_id>
</category>
<category>
<gsm>SFoo</gsm>
<category_id>2</category_id>
</category>
<category>
<gsm>MFoo</gsm>
<category_id>3</category_id>
</category>
</categories>

<region_codes>
<code>
<code_id>11000</code_id>
<code_name>Central</code_name>
</code>
<code>
<code_id>12000</code_id>
<code_name>Eastern</code_name>
</code>
<code>
<code_id>13000</code_id>
<code_name>Western</code_name>
</code>
<code>
<code_id>14000</code_id>
<code_name>Northern</code_name>
</code>
</region_codes>

<headers>
<header>
<header_id>1</header_id>
<header_name>Featured A</header_name>
</header>
<header>
<header_id>2</header_id>
<header_name>Featured B</header_name>
</header>
<header>
<header_id>3</header_id>
<header_name>Featured C</header_name>
</header>
</headers>

<advertisers>
<partner>
<name>Crestline</name>
<file>crestline.asp</file>
<logo>microsites/crestline/logo.jpg</logo>
<blurb>blah blah blah.</blurb>
<cat>3</cat>
<region>15000</region>
<header_type>1</header_type>
</partner>
<partner>
<name>Example 2</name>
<file>example2.asp</file>
<logo>microsites/meeting/example2.jpg</logo>
<blurb>example 2 example 2 example 2 example 2 example 2 example 2 example 2 example 2 example 2 .</blurb>
<cat>2</cat>
<region>14000</region>
<header_type>1</header_type>
</partner>
<partner>
<name>Example 3</name>
<file>example3.asp</file>
<logo>microsites/meeting/example3.jpg</logo>
<blurb>example 3 example 3 example 3 example 3 example 3 example 3 .</blurb>
<cat>3</cat>
<region>11000</region>
<header_type>1</header_type>
</partner>
<partner>
<name>Example 4</name>
<file>example4.asp</file>
<logo>microsites/meeting/example4.jpg</logo>
<blurb>example 4 example 4 example 4 example 4 example 4 example 4.</blurb>
<cat>1</cat>
<region>11000</region>
<header_type>1</header_type>
</partner>
<partner>
<name>Example 5</name>
<file>example5.asp</file>
<logo>microsites/meeting/example5.jpg</logo>
<blurb>example 5 example 5 example 5 example 5 example 5 example 5.</blurb>
<cat>1</cat>
<region>11000</region>
<header_type>1</header_type>
</partner>

<partner>
<name>Example 6</name>
<file>example6.asp</file>
<logo>microsites/meeting/example6.jpg</logo>
<blurb>example 6 example 6 example 6 example 6 example 6 example 6.</blurb>
<cat>2</cat>
<region>11000</region>
<header_type>2</header_type>
</partner>
<partner>
<name>Example 7</name>
<file>example7.asp</file>
<logo>microsites/meeting/example7.jpg</logo>
<blurb>example 7 example 7 example 7 example 7 example 7 example 7.</blurb>
<cat>3</cat>
<region>11000</region>
<header_type>3</header_type>
</partner>

<partner>
<name>Example 8</name>
<file>example8.asp</file>
<logo>microsites/meeting/example8.jpg</logo>
<blurb>example 8 example 8 example 8 example 8 example 8 example 8.</blurb>
<cat>1</cat>
<region>11000</region>
<header_type>3</header_type>
</partner>

<partner>
<name>Example 9</name>
<file>example9.asp</file>
<logo>microsites/meeting/example9.jpg</logo>
<blurb>example 9 example 9 example 9 example 9 example 9 example 9.</blurb>
<cat>1</cat>
<region>11000</region>
<header_type>3</header_type>
</partner>

<partner>
<name>Example 10</name>
<file>example10.asp</file>
<logo>microsites/meeting/example10.jpg</logo>
<blurb>example 10 example 10 example 10 example 10 example 10 example 10.</blurb>
<cat>1</cat>
<region>12000</region>
<header_type>2</header_type>
</partner>

</advertisers>

</master>

<?php

require_once("admin/assets/db_disconnect.php");

?>

最佳答案

删除除xml 之外的所有PHP header 标签并添加:

<head>
<meta http-equiv="Content-Type" content="application/xhtml+xml; charset=UTF-8" />
</head>

关于XML 解析错误 : junk after document element,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/1364101/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com