[Bug Report ?!] Line return erased from xml attributes.
| From: | Sébastien MICHEL | Date: | Tue, 10 Dec 2002 02:06:25 +0000 |
| Subject: | [Bug Report ?!] Line return erased from xml attributes. | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-127589@lists.php.net to get a copy of this message | ||
Hi,
I have a problem with my php4.1.2 from debian woody (because this
version that why I didn't post a bug report).
When I parsing an xml file.
Returns (\r or \n) don't appear in string resulted from xml object
attribut.
_exple_:
<object attribut="bob
in the church">
function startElement($parser, $name, $attrs) {
...
var_dump ($attrs[ATTRIBUT]);
/* result is "bob in the church"
and it should be "bob
in the church"
*/
...
}
$xml_parser = xml_parser_create();
xml_set_element_handler($xml_parser, "startElement", "endElement");
if (!($fp = fopen($file, "r"))) {
die("could not open XML input");
}
while ($data = fread($fp, 4096)) {
if (!xml_parse($xml_parser, $data, feof($fp))) {
die(sprintf("XML error: %s at line %d",
xml_error_string(xml_get_error_code($xml_parser)),
xml_get_current_line_number($xml_parser)));
}
}
xml_parser_free($xml_parser);
fclose($fp);
thx for help.
--
._.·Ž¯
·._.·Ž¯·-> ]V[ ! C |-| O |_| X <-._.·Ž¯·._.·Ž¯