From my reserach on the Net (php.net does not seem to have any info on this), it seems this error is mostly due to unacceptable characters ('&' being the main suspect I believe) in the XML document being parsed. But I have a strange problem with a simple XML Document that I cannot debug. The following lines of code are responsible:
$parser = xml_parser_create('');
xml_parser_set_option($parser,XML_OPTION_SKIP_WHITE,1);
$suc = xml_parse_into_struct($parser,$ret,&$val,&$index);
if (!$suc)
self::logIt("got an error parsing \n$ret\n:".xml_error_string(xml_get_error_code($parser)));
xml_parser_free($parser);
The corresponding log entry is:
07 Jan 2010 01:32:45: got an error parsing
<?xml version="1.0" encoding="UTF-8"?>
<array>
<1>platinum</1>
<2>gold</2>
<3>value</3>
</array>
:XML_ERR_NAME_REQUIRED
The Soap response the above XML came from is is:
<?xml version="1.0" encoding="UTF-8"?>
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://172.16.0.200/webservices" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Body><ns1:getCustSlaDescsResponse><return xsi:type="xsd:string"><?xml version="1.0" encoding="UTF-8"?>
<array>
<1>platinum</1>
<2>gold</2>
<3>value</3>
</array>
</return></ns1:getCustSlaDescsResponse></SOAP-ENV:Body></SOAP-ENV:Envelope>
Any pointers would be highly appreciated!!