Hi Ben,

Had the same problem.  The solution I came up with was to populate the value
repeatedly by concantenation.

$thisxmlval .= (whatever is sent from the parser).

Note the . in front of the =

As long as the parser is still sending values from this tag, your program
should concantenate them, thereby producing one value which was the original
content of the tag.

kind regards,

bill

Ben Gollmer wrote:

> Hi all -
>
> I'm experimenting with PHP's XML parser for an application that maps XML
> tags to MySQL database fields.
>
> As a test for my parsing program, I've been grabbing XML from the
> Slashdot news feed (http://www.slashdot.org/slashdot.xml) and inserting
> it into a database. This is very simple data - <title>blah</title> gets
> inserted into the 'title' field, etc. However, when there are some
> strange characters in the title field, the XML parser seems to choke.
>
> Here is an example. The title of a recent article from Slashdot looks
> like this in the XML file:
>
> <title>Follow-up To Critique of BeOS &amp;amp; Mac OS X</title>
>
> Don't ask my why they have a double ampersand in there... Anyway, the
> XML parser returns this as three sets of data, instead of one. The array
> that I get looks like this:
>
> $myArray[0] = "Follow-up To Critique of BeOS "
> $myArray[1] = "&"
> $myArray[2] = "amp; Mac OS X"
>
> This is the data I get back from the parser, BEFORE putting it into the
> database. I'm echoing each array field to the screen, just to make sure.
> So I know it has nothing to do with MySQL. The double ampersand
> shouldn't make a difference - the XML parser should not be interpreting
> HTML...right? Also, I don't get an error code or error string from
> xml_parse().
>
> Anyone have any ideas? This is a subtle bug - in fact I had been
> satisfied with my XML parsing code, and was well into the rest of my
> application when I happened to notice this.
>
> Ben


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]

Reply via email to