Question

I am getting the below error:-

Strict Standards: Non-static method DOMDocument::loadXML() should not be called statically

in below line

$xml_handle = DOMDocument::loadXML($xml_datas, LIBXML_NOENT 
 | LIBXML_XINCLUDE | LIBXML_NOERROR | LIBXML_NOWARNING);

from below code:-

while(($xml_index = $zip_handle->locateName("ppt/slides/slide".$slide_number.".xml")) !== false){
            $xml_datas = $zip_handle->getFromIndex($xml_index);
            //die("here ====".$slide_number.$xml_datas);
            $xml_handle = DOMDocument::loadXML($xml_datas, LIBXML_NOENT | LIBXML_XINCLUDE | LIBXML_NOERROR | LIBXML_NOWARNING);
            //print_r($xml_handle);die($xml_handle);
            $output_text.= strip_tags($xml_handle->saveXML() );
            $slide_number++;
        }

Any help is appreciated...

Was it helpful?

Solution

Using Strict Standards, you should instantiate DOMDocument instead of calling loadXML statically:

$xml_handle = new DOMDocument();
$xml_handle->loadXML($xml_datas, LIBXML_NOENT | LIBXML_XINCLUDE | LIBXML_NOERROR | LIBXML_NOWARNING);

This will eliminate the error.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top