|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #25549 xml_parse() function error
Submitted: 2003-09-15 16:06 UTC Modified: 2003-09-15 18:17 UTC
From: choor at bigmir dot net Assigned:
Status: Not a bug Package: *XML functions
PHP Version: 4.3.3 OS: FreeBSD 4.7-RELEASE & Windows XP
Private report: No CVE-ID: None
 [2003-09-15 16:06 UTC] choor at bigmir dot net
xml_parse() function error.
This error appears every time xml_parse() function found "&"(ampersand) in xml-content.

XML file Example:
10: ...
11: <item>
12: <title>Command & Conquer: Generals</title>
13:  <txt>Command & Conquer: Generals - Game Addon</txt>
14:  <category>Games/Red Alert</category>
15: </item>
16: ...

This error will occur in line 12, if I cut '&' there then error will occur in line 13.
If I cut all '&' no errors will occur.

Reproduce code:
Standart code from PHP manual:
if (!xml_parse($xml_parser, $data, feof($fp)))
  die(sprintf("XML error: %s at line %d",

Expected result:
Formated HTML text.

Actual result:
XML error: not well-formed (invalid token) at line 12


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2003-09-15 18:17 UTC]
Thank you for taking the time to write to us, but this is not
a bug. Please double-check the documentation available at and the instructions on how to report
a bug at

& should be &amp; in valid XML.
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Tue Jul 23 06:01:30 2024 UTC