XML Parsing....
| From: | Scott Fletcher | Date: | Thu, 20 Nov 2003 16:18:08 +0000 |
| Subject: | XML Parsing.... | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-170427@lists.php.net to get a copy of this message | ||
Hi Everyone!
I'm having a little trouble understanding how exactly to use the XML
parser. I haven't found the right settings to set up the XML Parser's
option because of no definition of the encoding setting in the XML tags I
received. So, I'll post the script here and hope to get some feedback on
this...
--snip--
$data = "<REPORT_RESPONSE>";
//Lots of XML tags goes here but is taken out for shorter
scripting....
$data = " <![CDATA[<?xml version="1.0"
encoding="UTF-8"?>";
//Lots of other XML tags goes here but is taken out for shorter
scripting....
$data = " <![CDATA[***HTML CODES GOES HERE****]]>";
//Lots of other XML tags goes here but is taken out for shorter
scripting....
$data = " ]]>";
//Lots of other XML tags goes here but is taken out for shorter
scripting....
$data .= "</REPORT_RESPONSE>";
$parser = xml_parser_create('ISO-8859-1');
xml_parser_set_option($parser, XML_OPTION_SKIP_WHITE, 1);
xml_parser_set_option($parser, XML_OPTION_CASE_FOLDING, 0);
xml_parse_into_struct($parser, $data, $vals, $index);
xml_parser_free($parser);
--snip--
The problem here is that I have like two different XML encoding
format....
Thanks,
Scott