[PHP] Re: fread problem

2006-01-04 Thread Haydar Ciftci

How looks your characterData function?

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



[PHP] Re: fread problem

2006-01-03 Thread Mario de Frutos Dieguez
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Yes, sorry i forget send some example code. Here is:


$xml_parser = xml_parser_create();
// usa case-folding para que estemos seguros de encontrar la etiqueta
// en $map_array
xml_parser_set_option($xml_parser, XML_OPTION_CASE_FOLDING, true);
xml_set_element_handler($xml_parser, startElement, endElement);
xml_set_character_data_handler($xml_parser, characterData);
if (!($fp = fopen($file, rb))) {
   die(could not open XML input);
}

while ($data = fread($fp, 12288)) {
   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)));
   }
}   

If i put fread($fp, 8192) i obtain the same text and if a put 4096 it
cut before.
- --
**
FUNDACIÓN CARTIF

  MARIO DE FRUTOS DIEGUEZ - Email: [EMAIL PROTECTED]
 División de Ingeniería del Software y Comunicaciones

   Parque Tecnológico de Boecillo, Parcela 205
   47151 - Boecillo (Valladolid) España
  Tel.   (34) 983.54.88.21 Fax(34) 983.54.65.21
**
Este mensaje se dirige exclusivamente a su destinatario y puede contener
información CONFIDENCIAL sometida a secreto profesional o cuya
divulgación esté prohibida en virtud de la legislación vigente. Si ha
recibido este mensaje por error, le rogamos que nos lo comunique
inmediatamente por esta misma vía y proceda a su destrucción.

Nótese que el correo electrónico via Internet no permite asegurar ni la
confidencialidad de los mensajes que se transmiten ni la correcta
recepción de los mismos. En el caso de que el destinatario de este
mensaje no consintiera la utilización del correo electrónico vía
Internet, rogamos lo ponga en nuestro conocimiento de manera inmediata.
***
This message is intended exclusively for its addressee and may contain
information that is CONFIDENTIAL and protected by a professional
privilege or whose disclosure is prohibited by law. If this message has
been received in error, please immediately notify us via e-mail and
delete it.

Please note that Internet e-mail neither guarantees the confidentiality
nor the proper receipt of the messages sent. If the addressee of this
message does not consent to the use of Internet e-mail, please
communicate it to us immediately.

-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.1 (GNU/Linux)
Comment: Using GnuPG with Thunderbird - http://enigmail.mozdev.org

iD8DBQFDunbvbPPtxT8v/3wRAjBwAJ4kHE0cdyrvruFE3LlSGXMKFri5fwCfU7ii
machwamViid/Hr8lXPrv8e8=
=xyJI
-END PGP SIGNATURE-

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