[PHP-DEV] PHP 4.0 Bug #6146 Updated: xml_parse() passes character entities incorrectly

2001-02-19 Thread thies

ID: 6146
Updated by: thies
Reported By: [EMAIL PROTECTED]
Old-Status: Open
Status: Closed
Bug Type: XML related
Assigned To: 
Comments:

that's the way expat works - you are never guaranteed that 
cdata is deliverd to the callback in one piece.




Previous Comments:
---

[2001-02-19 06:03:27] [EMAIL PROTECTED]
Try the code. It shows what happens. The output should be same for
both test cases (the one with entitities breaks, ie. every entity is considered
a string itself)

I'm not sure if this is a bug in PHP but more likely in expat library itself.

--Jani


---

[2001-02-15 08:51:17] [EMAIL PROTECTED]
what is wrong with the output?


---

[2000-08-14 07:45:20] [EMAIL PROTECTED]
Here are an example xml-file and php-script which demonstrates
this behaviour:
-



åäöÅÄÖ
åäöÅÄÖ


-

";
}

$xml_parser = xml_parser_create();
xml_set_character_data_handler($xml_parser, "characterData");

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)));
}
}

?>

-

php configure line:

./configure 
--prefix=/data --with-config-file-path=/data/conf  
--with-mysql=/data/kolumbustori
--without-gd --disable-pear
--disable-debug

And the output with those files:
 
* *
* *
*åäöÅÄÖ*
* *
* *
*å*
*ä*
*ö*
*Å*
*Ä*
*Ö*
* *

--Jani

---



ATTENTION! Do NOT reply to this email!
To reply, use the web interface found at http://bugs.php.net/?id=6146&edit=2


-- 
PHP Development Mailing List 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP-DEV] PHP 4.0 Bug #6146 Updated: xml_parse() passes character entities incorrectly

2001-02-19 Thread sniper

ID: 6146
Updated by: sniper
Reported By: [EMAIL PROTECTED]
Old-Status: Feedback
Status: Open
Bug Type: XML related
Assigned To: 
Comments:

Try the code. It shows what happens. The output should be same for
both test cases (the one with entitities breaks, ie. every entity is considered
a string itself)

I'm not sure if this is a bug in PHP but more likely in expat library itself.

--Jani


Previous Comments:
---

[2001-02-15 08:51:17] [EMAIL PROTECTED]
what is wrong with the output?


---

[2000-08-14 07:45:20] [EMAIL PROTECTED]
Here are an example xml-file and php-script which demonstrates
this behaviour:
-



åäöÅÄÖ
åäöÅÄÖ


-

";
}

$xml_parser = xml_parser_create();
xml_set_character_data_handler($xml_parser, "characterData");

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)));
}
}

?>

-

php configure line:

./configure 
--prefix=/data --with-config-file-path=/data/conf  
--with-mysql=/data/kolumbustori
--without-gd --disable-pear
--disable-debug

And the output with those files:
 
* *
* *
*åäöÅÄÖ*
* *
* *
*å*
*ä*
*ö*
*Å*
*Ä*
*Ö*
* *

--Jani

---



ATTENTION! Do NOT reply to this email!
To reply, use the web interface found at http://bugs.php.net/?id=6146&edit=2


-- 
PHP Development Mailing List 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP-DEV] PHP 4.0 Bug #6146 Updated: xml_parse() passes character entities incorrectly

2001-02-15 Thread thies

ID: 6146
Updated by: thies
Reported By: [EMAIL PROTECTED]
Old-Status: Open
Status: Feedback
Bug Type: XML related
Assigned To: 
Comments:

what is wrong with the output?


Previous Comments:
---

[2000-08-14 07:45:20] [EMAIL PROTECTED]
Here are an example xml-file and php-script which demonstrates
this behaviour:
-



åäöÅÄÖ
åäöÅÄÖ


-

";
}

$xml_parser = xml_parser_create();
xml_set_character_data_handler($xml_parser, "characterData");

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)));
}
}

?>

-

php configure line:

./configure 
--prefix=/data --with-config-file-path=/data/conf  
--with-mysql=/data/kolumbustori
--without-gd --disable-pear
--disable-debug

And the output with those files:
 
* *
* *
*åäöÅÄÖ*
* *
* *
*å*
*ä*
*ö*
*Å*
*Ä*
*Ö*
* *

--Jani

---



ATTENTION! Do NOT reply to this email!
To reply, use the web interface found at http://bugs.php.net/?id=6146&edit=2


-- 
PHP Development Mailing List 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]