In any case, this error is not caused by ZF, but from simplexml.
When you say that the file is always there, and you've seen that the error
is thrown by simplexml_load_file I expect that there is a caching issue or a
problem with multiple accesses/multithreading.
Have you installed APC or some other file caching extension maybe on the OS
?
I've seen sort of this error reported but without being able to reproduce it
on any machine.
Do you receive this error always, or only particular from time to time ?
Which ZF release, which PHP release, which OS ?
Greetings
Thomas Weidner, I18N Team Leader, Zend Framework
http://www.thomasweidner.com
----- Original Message -----
From: "Terre Porter" <[email protected]>
To: <[email protected]>
Sent: Friday, January 30, 2009 7:15 AM
Subject: [fw-general] Zend_Locale - simplexml_load_file - parser error :
Document is empty
Anyone know what might have caused this error ?
Warning: simplexml_load_file() [function.simplexml-load-file]:
/home/tbnweek/public_html/e-edition/includes/Zend/Locale/Data/en_US.xml:1:
parser error : Document is empty in
/home/tbnweek/public_html/e-edition/includes/Zend/Locale/Data.php on line
146
This was working earlier today but suddenly has decided to die.
$locale = new Zend_Locale('en_US');
The code from data.php :
if (empty(self::$_ldml[(string) $locale])) {
$filename = dirname(__FILE__) . '/Data/' . $locale . '.xml';
if (!file_exists($filename)) {
require_once 'Zend/Locale/Exception.php';
throw new Zend_Locale_Exception("Missing locale file
'$filename' for '$locale' locale.");
}
self::$_ldml[(string) $locale] =
simplexml_load_file($filename);
}
The file is not empty.
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE ldml SYSTEM "http://www.unicode.org/cldr/dtd/1.6/ldml.dtd">
<ldml>
<identity>
<version number="$Revision: 1.51 $"/>
<generation date="$Date: 2008/05/28 15:49:30 $"/>
<language type="en"/>
<territory type="US"/>
</identity>
</ldml>
Thanks, Terre