Support » Fixing WordPress » add http headers

  • Hi,

    Do I need to add header("Content-type: text/xml");to my script or somewhere in my site in order to parse XML? If so, how do I go about doing that?

    code snippet that requires the header:

    header("Content-type: text/xml");
    
    $dom = new DOMDocument("1.0");
    $node = $dom->createElement($wpdb->prefix.'address_table');
    $parnode = $dom->appendChild($node); 
    
     $node = $dom->createElement("marker");
    		  $newnode = $parnode->appendChild($node);
    		  $newnode->setAttribute("lat",$data->results[0]->geometry->location->lat);
    		  $newnode->setAttribute("lng", $data->results[0]->geometry->location->lng); 
    
    echo $dom->saveXML();

    This is the error I get:
    error on line 7 at column 45: Entity ‘raquo’ not defined

  • The topic ‘add http headers’ is closed to new replies.