Advertisement
XML Parsing Error at 1:1. Error 4: Empty document
Moderator: General Support Moderators
Forum rules
Forum Rules
Absolute Beginner's Guide to Joomla! <-- please read before posting, this means YOU.
Forum Rules
Absolute Beginner's Guide to Joomla! <-- please read before posting, this means YOU.
- gold
- Joomla! Apprentice
- Posts: 20
- Joined: Tue Nov 04, 2008 1:20 am
- Location: perth
- Contact:
XML Parsing Error at 1:1. Error 4: Empty document
Hi everybody,
I have some trouble with installing a custom template.
When I install the template I get the following error:
XML Parsing Error at 1:1. Error 4: Empty document
The template than is installed successfully and runs but i really don't want to have the parsing error coming up.
cheers
gold
I have some trouble with installing a custom template.
When I install the template I get the following error:
XML Parsing Error at 1:1. Error 4: Empty document
The template than is installed successfully and runs but i really don't want to have the parsing error coming up.
cheers
gold
Advertisement
-
- Joomla! Apprentice
- Posts: 40
- Joined: Tue May 30, 2006 11:12 pm
- Location: Vancouver, BC
- Contact:
Re: XML Parsing Error at 1:1. Error 4: Empty document
A further observation: I'm seeing this error with my template in a Joomla! 1.5.9 site.
Just for fun I tried installing that very same template in an experimental Joomla 1.5.3 site which is close to a bare install of the basic Joomla distribution. It installed with no error message. I then upgraded that site to Joomla 1.5.9 using the 1.5.3-> 1.5.9 upgrader. I uninstalled the template, then installed it again. This time, the error occurred. This makes me think that 1.5.9 behaves differently than 1.5.3 in some which which either is an error, or tickles the error in my templateDetails.xml file.
I tried stripping my templateDetails.xml file down to a bare minimum. The error still occured.
Is anyone else seeing this error message?
Just for fun I tried installing that very same template in an experimental Joomla 1.5.3 site which is close to a bare install of the basic Joomla distribution. It installed with no error message. I then upgraded that site to Joomla 1.5.9 using the 1.5.3-> 1.5.9 upgrader. I uninstalled the template, then installed it again. This time, the error occurred. This makes me think that 1.5.9 behaves differently than 1.5.3 in some which which either is an error, or tickles the error in my templateDetails.xml file.
I tried stripping my templateDetails.xml file down to a bare minimum. The error still occured.
Is anyone else seeing this error message?
Jim DeLaHunt, multilingual website consultant (jdlh.com), Vancouver, Canada. http://blog.jdlh.com
-
- Joomla! Apprentice
- Posts: 40
- Joined: Tue May 30, 2006 11:12 pm
- Location: Vancouver, BC
- Contact:
Re: XML Parsing Error at 1:1. Error 4: Empty document
Problem diagnosed!
I was generating a compressed archive installable for the template, i.e. mytemplate.zip. I did this on Mac OS X 10.5.x Finder, by selecting all the files and directories of the template, right-clicking on one of the file icons, and selecting "Compress". Finder produced a file "Archive.zip", which I renamed.
Mac OS X archive utilities like compress and tar store metadata and resource forks for files in sidecar files with a "._" prefix followed by the main file's name. They put these in a subdirectory tree __MACOSX. Thus my archives had an 82-byte file __MACOSX/._templateDetails.xml in addition to the correct templateDetails.xml. See OSX Considered harmful for someone else who found this behaviour an obstacle.
The template installer looks for all files with an extension ".xml" in the archive, and calls JSimpleXML::_parse() on each one of them. It looks like there was something about the ._templateDetails.xml file which caused the parser to throw an error, not just return a failure code. This provoked JSimpleXML to produce the XML Parsing Error at 1:1. Error 4: Empty document message, before using the correct templateDetails.xml file to complete the installation.
It's interesting that Joomla 1.5.9 reports an error message, while Joomla 1.5.3 does not. I'm guessing that 1.5.9 is more diligent about passing error messages on to the user. I think it would be helpful if Joomla would extend this error message to include a file name. Maybe even not pass on such error messages as long as one of the XML files in the archive is valid.
The fix for this problem is one of:
I was generating a compressed archive installable for the template, i.e. mytemplate.zip. I did this on Mac OS X 10.5.x Finder, by selecting all the files and directories of the template, right-clicking on one of the file icons, and selecting "Compress". Finder produced a file "Archive.zip", which I renamed.
Mac OS X archive utilities like compress and tar store metadata and resource forks for files in sidecar files with a "._" prefix followed by the main file's name. They put these in a subdirectory tree __MACOSX. Thus my archives had an 82-byte file __MACOSX/._templateDetails.xml in addition to the correct templateDetails.xml. See OSX Considered harmful for someone else who found this behaviour an obstacle.
The template installer looks for all files with an extension ".xml" in the archive, and calls JSimpleXML::_parse() on each one of them. It looks like there was something about the ._templateDetails.xml file which caused the parser to throw an error, not just return a failure code. This provoked JSimpleXML to produce the XML Parsing Error at 1:1. Error 4: Empty document message, before using the correct templateDetails.xml file to complete the installation.
It's interesting that Joomla 1.5.9 reports an error message, while Joomla 1.5.3 does not. I'm guessing that 1.5.9 is more diligent about passing error messages on to the user. I think it would be helpful if Joomla would extend this error message to include a file name. Maybe even not pass on such error messages as long as one of the XML files in the archive is valid.
The fix for this problem is one of:
- Use some platform other than Mac OS X to generate your installable archives.
- On Mac OS X, compress from the shell. Execute export COPYFILE_DISABLE=true first, then your compress command like zip -r ../mytemplate.zip *.
Jim DeLaHunt, multilingual website consultant (jdlh.com), Vancouver, Canada. http://blog.jdlh.com
- gold
- Joomla! Apprentice
- Posts: 20
- Joined: Tue Nov 04, 2008 1:20 am
- Location: perth
- Contact:
Re: XML Parsing Error at 1:1. Error 4: Empty document
good work, thanks so much!
-
- Joomla! Apprentice
- Posts: 40
- Joined: Tue May 30, 2006 11:12 pm
- Location: Vancouver, BC
- Contact:
Re: XML Parsing Error at 1:1. Error 4: Empty document
If you'd like to read more about my diagnosis of this problem, check out the blog posting I just wrote: How to resolve “XML Parsing Error at 1:1. Error 4: Empty document” when installing a Joomla template or extension.
"May no-one else have to spend the hours I spent diagnosing this problem!"
"May no-one else have to spend the hours I spent diagnosing this problem!"
Jim DeLaHunt, multilingual website consultant (jdlh.com), Vancouver, Canada. http://blog.jdlh.com
- kai920
- Joomla! Guru
- Posts: 542
- Joined: Sun Sep 04, 2005 3:59 pm
- Location: Hong Kong
Re: XML Parsing Error at 1:1. Error 4: Empty document
Hey Jim,
Nice find man, I just ran into the same issue. Packaged the template in XP and the XML error is gone. I only 'wasted' maybe 15 minutes before I found this thread.
Thanks!
Nice find man, I just ran into the same issue. Packaged the template in XP and the XML error is gone. I only 'wasted' maybe 15 minutes before I found this thread.
Thanks!
- RC3 Media
- Joomla! Apprentice
- Posts: 26
- Joined: Fri Jul 17, 2009 6:02 pm
- Location: Los Angeles, Ca
- Contact:
Re: XML Parsing Error at 1:1. Error 4: Empty document
Great, this works. Thanks
I bring your digital ideas to life.
-
- Joomla! Apprentice
- Posts: 9
- Joined: Thu Apr 10, 2008 7:30 pm
Re: XML Parsing Error at 1:1. Error 4: Empty document
I've done an entire joomla website with a mac compressing the modules/components/templates and I've had no problem on my hosting server. Once finished, I transferred it to the customer's hosting server and all the sudden I'm getting so many of these errors:
XML Parsing Error at 1:1. Error 4: Empty document
especially when I go to the installer to uninstall something.
What is the solution now?? Can I just delete the ._xxx.xml files from the folders?
Thanks in advance.
XML Parsing Error at 1:1. Error 4: Empty document
especially when I go to the installer to uninstall something.
What is the solution now?? Can I just delete the ._xxx.xml files from the folders?
Thanks in advance.
-
- Joomla! Apprentice
- Posts: 40
- Joined: Tue May 30, 2006 11:12 pm
- Location: Vancouver, BC
- Contact:
Re: XML Parsing Error at 1:1. Error 4: Empty document
One of my clients had a similar problem, and that fix worked for me. I don't know of a reason why any file named ._*.xml should stay on a web server's file system.yosia wrote:Can I just delete the ._xxx.xml files from the folders?
Good luck!
--Jim DeLaHunt, Vancouver, Canada. Multilingual Joomla & Drupal website consultant.
Jim DeLaHunt, multilingual website consultant (jdlh.com), Vancouver, Canada. http://blog.jdlh.com
-
- Joomla! Apprentice
- Posts: 13
- Joined: Fri Jun 26, 2009 4:50 am
Re: XML Parsing Error at 1:1. Error 4: Empty document
Hello to all,
m also getting the same error....."XML Parsing Error at 1:1. Error 4: Empty document"....
is this any serious matter.....?
I mean the module I was installed was work perfectly. Only while installing that module at that time I got the error.
Is it fine if I continued to work on my blog or should take some action about this error.
I never get this error while installing other components, modules.
help needed......
Reards
Vishal
m also getting the same error....."XML Parsing Error at 1:1. Error 4: Empty document"....
is this any serious matter.....?
I mean the module I was installed was work perfectly. Only while installing that module at that time I got the error.
Is it fine if I continued to work on my blog or should take some action about this error.
I never get this error while installing other components, modules.
help needed......
Reards
Vishal
-
- Joomla! Apprentice
- Posts: 40
- Joined: Tue May 30, 2006 11:12 pm
- Location: Vancouver, BC
- Contact:
Re: XML Parsing Error at 1:1. Error 4: Empty document
You might find my blog post, How to resolve “XML Parsing Error at 1:1. Error 4: Empty document” when installing a Joomla template or extension, informative. Read that and see if it answers your questions.seeumee wrote:m also getting the same error....."XML Parsing Error at 1:1. Error 4: Empty document"....
is this any serious matter.....?
--Jim DeLaHunt, Vancouver, Canada. Multilingual Joomla & Drupal website consultant.
Jim DeLaHunt, multilingual website consultant (jdlh.com), Vancouver, Canada. http://blog.jdlh.com
-
- Joomla! Fledgling
- Posts: 2
- Joined: Thu Jan 14, 2010 4:48 am
Re: XML Parsing Error at 1:1. Error 4: Empty document
That was really helpful. This is a awsome forum for joomla users.
http://www.ideaheart.com
The Ih!Stuff, Community, Games, Quiz, Music, Polls, Photos, Videos, Clips and many more.
The Ih!Stuff, Community, Games, Quiz, Music, Polls, Photos, Videos, Clips and many more.
- mediaguru
- Joomla! Enthusiast
- Posts: 142
- Joined: Mon Sep 19, 2005 3:56 am
- Location: USA
- Contact:
Re: XML Parsing Error at 1:1. Error 4: Empty document
FYI, I've run into this problem many times when trying to use the Mac OS compress function to create zip files for joomla plugin or template installs. You don't have to use another computer to avoid the problem though. I'm able to zip files in a linux shell in OSX and it works great.
Advertisement