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 <-._.·´¯`·._.·´¯`

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to