Re: XML Parsing Problem
| From: | Ben Gollmer | Date: | Thu, 03 Jan 2002 23:18:15 +0000 |
| Subject: | Re: XML Parsing Problem | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-79386@lists.php.net to get a copy of this message | ||
Huh - I guess it could be useful. I still think this should be an option you could set with xml_parser_set_option(), or something.
In case anyone is interested, I solved the problem by creating a new global variable, $previousTag. Each time my character parsing function is called, it compares the previous tag to the current tag. If they are the same, the data gets stuffed into a buffer; if they are different, the buffer is returned, cleared, and the new data stuffed into it...and $previousTag is set to the current tag.
Ben
On Wednesday, January 2, 2002, at 06:41 PM, Matthew Clark wrote:
well thats just the way XML parsers work, according to the parser, what you have there is not a single string element, you have three child elements (the parent node being the <title>).. two string nodes broken up by an entity node. In other circumstances, this behaviour can be very useful. Matt. -----Original Message----- From: Ben Gollmer [mailto:ben@jatosoft.com] Sent: 02 January 2002 23:16 To: matt@genicomsystems.com Cc: php-general@lists.php.net Subject: Re: [PHP] XML Parsing Problem Ok, I can understand the predefined entity replacement. But why does it break the string up into 3 parts? I think it should just return "Follow-up To Critique of BeOS & Mac OS X". Ben