On Thursday 20 November 2003 08:18 am, Scott Fletcher wrote: > 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....
Do you actually have data in two diferent formats in the same XML file, or can you just change xml_parser_create to UTF-8 and be done with it? Does the XML standard even allow multiple encodings??? > > Thanks, > Scott -- Evan Nemerson [EMAIL PROTECTED] http://coeusgroup.com/en -- "The greatest mistake is to imagine that the human being is an autonomous individual. The secret freedom which you can supposedly enjoy under a despotic government is nonsense, because your thoughts are never entirely your own. Philosophers, writers, artists, even scientists, not only need encouragement and an audience, they need constant stimulation from other people. It is almost impossible to think without talking. If Defoe had really lived on a desert island, he could not have written Robinson Crusoe, nor would he have wanted to. Take away freedom of speech, and the creative faculties dry up." -George Orwell -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php