Skrypt A w pliku a.php generuje xml'a:
header('Content-type: application/xml; charset="utf-8"'); $fileContent.= '<?xml version="1.0" encoding="utf-8"?.">\n"; $fileContent.= "<element_glowny>\n"; $fileContent.= "<el2>\n"; $fileContent.= "s</el2>\n"; $fileContent.= "</element_glowny>\n"; ?>
Skrypt B w pliku b.php "stara się" odczytac xml'a wygenerowanego przez plik a.php:
<?php ?>
Otrzymuje komunikat bledu:
"Warning: SimpleXMLElement::__construct(): Entity: line 11: parser error : Start tag expected, '<' not found in /srv/www/htdocs/vhosts/domaindb/test3.php on line 5
Warning: SimpleXMLElement::__construct(): ?> in /srv/www/htdocs/vhosts/domaindb/test3.php on line 5
Warning: SimpleXMLElement::__construct(): ^ in /srv/www/htdocs/vhosts/domaindb/test3.php on line 5
Fatal error: Uncaught exception 'Exception' with message 'String could not be parsed as XML' in /srv/www/htdocs/vhosts/domaindb/test3.php:5 Stack trace: #0 /srv/www/htdocs/vhosts/domaindb/test3.php(5): SimpleXMLElement->__construct('
"
Ktoś może mi wskazac gdzie robie błąd_