我得到“ EntityRef:期待';'通过 php 创建 xml 时出错“

I am getting " EntityRef: expecting ';' error while creating xml through php "

这是我的 XML,我正在使用 php 代码创建此 xml。代码见截图:

<?xml version="1.0"?>
<LoggedErrors>
  <LoggedError>
  <DateTime>2018-03-30T10:28:28+00:00</DateTime>
  <Errors/>
  <Request>
    <FlightGroup>
      <ArrivalTime>
        <Hour>12</Hour>
        <Millisecond>0</Millisecond>
        <Minutes>20</Minutes>
        <Seconds>0</Seconds>
        <Day>12</Day>
        <DayOfWeek>Thursday</DayOfWeek>
        <Month>4</Month>
        <Year>2018</Year>
      </ArrivalTime>
    </FlightGroup>
   </Request>
 </LoggedError>
</LoggedErrors>
public  function printResult($raw_data){
    // adding Content Type
    header("Content-type: text/xml");
    // Converts PHP Array to XML with the root element being 'root-element-here'
    $xml = Excellence_Envision_Helper_Errorflile::createXML('LoggedError', $raw_data);

    return $xml->saveXML();

    }

尝试从您的函数中删除此代码,我认为它会正常工作。

header("Content-type: text/xml");