Ismail Khan
Ismail Khan

Reputation: 49

how to use php in big xml file?

I want use php to fetch data from mysql database and set values in xml file, I try different things such as

libxml_use_internal_errors(true);
$myXMLData=
    "<?xml version='1.0'?>............(12000lines).............";
$xml = simplexml_load_string($myXMLData);
if ($xml === false) {
    echo "Failed loading XML: ";
    foreach(libxml_get_errors() as $error) {
        echo "<br>", $error->message;
    }
} else {
    print_r($xml);
}
?>

and etc but nothing work. The above methode show error in alot of lines as xml file is too big as you can see it image.enter image description here Please let me know if there is any way to use PHP in xml file. Thank you

thats the file which displays errors

Upvotes: 2

Views: 38

Answers (1)

Nigel Ren
Nigel Ren

Reputation: 57121

There is a problem with the data at this element...

<NamedRange ss:Name='Print_Area' ss:RefersTo='='MSI APR-18'!R1C2:R94C21'/>

It may be that in processing it, the double quotes have been replaced by single quotes and this means that the ss:RefersTo attribute has an illegal value.

You could just edit this line to be

<NamedRange ss:Name='Print_Area' ss:RefersTo=\"='MSI APR-18'!R1C2:R94C21\"/>

and it should work.

Upvotes: 2

Related Questions