1

This is my XML,I am using php code for creating this xml. Please see screenshot for code:enter image description here

<?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>
Vishal Thakur
  • 1,564
  • 16
  • 25
  • Please don't post code as images, also if your getting an error it would help to have the full error and any indication of where the error is happening. – Nigel Ren Mar 30 '18 at 10:56

1 Answers1

3
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();

    }

Try to remove this code from your function and I think it will work fine then.

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