简体   繁体   中英

error in DOMDocument::loadXML

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...

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM