WordPress中的html文件的XML解析错误

时间:2018-01-13 05:38:04

标签: php html xml wordpress

我正在运行一个Wordpress网站并使用' Includeme'插件在我的Wordpress帖子中包含html文件。假设要包含的html文件的名称是" navigation_file.html",此文件看起来像这样。

<?php

$str= '<th class="s1">Select chapter</th>
<th class="s2"><select onchange="location=this.value;" > 
<option selected>绔犮倰閬告姙</option>' ; 

 $xml=simplexml_load_file("mysite.com/direct/100_Man/xmlfile.xml"); <!-- Line 7 -->

  foreach( $xml->children() as $books )
  {
   $str.='<option value="../'.$books->link.'" >'.$books->chapt.'</option>';
  }

echo $str.'</select></th>' ;
?>

我有&#39; xmlfile.xml&#39;以上html文件试图包含的内容如下:

 <?xml version="1.0" encoding="utf-8"?>
  <chapter_list>
  <list>
  <link>100万の命の上に俺は立っている-20-100-man-no-inochi-no-ue-ni-ore-wa-tatte-iru-20-raw/</link>
   <chapt>100万の命の上に俺は立っている 20</chapt>
  </list>

  <list>
  <link>100万の命の上に俺は立っている-19-100-man-no-inochi-no-ue-ni-ore-wa-tatte-iru-19-raw/</link>
    <chapt>100万の命の上に俺は立っている 19</chapt>
  </list>
   .....
   </chapter_list>

现在我使用&#34; includeme&#34;插件短代码包括&#34; navigation_file.html&#34;: [includeme file =&#34; direct / 100_Man / navigation_file.html&#34;] 。现在我预览我得到的帖子错误警告:simplexml_load_file():在第7行的/home1/newfile/public_html/direct/100_Man/navigation_file.html 第7行标记在&#34; navigation_file.html&#34; ,请注意这里的所有目录都是正确的。而且我之前从未遇到过这个问题,只是现在问题出现了a =无处不在。

任何帮助都将不胜感激,谢谢。

0 个答案:

没有答案