XML Parsing Error at 1:1. Error 4: Empty document

Everything to do with Joomla! 1.5 templates and templating.

Moderator: General Support Moderators

Forum rules
Forum Rules
Absolute Beginner's Guide to Joomla! <-- please read before posting, this means YOU.
User avatar
gold
Joomla! Apprentice
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

Postby gold » Sun Dec 28, 2008 7:42 am

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

JimDeLaHunt
Joomla! Apprentice
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

Postby JimDeLaHunt » Tue Feb 03, 2009 10:57 am

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?
Jim DeLaHunt, multilingual website consultant (jdlh.com), Vancouver, Canada. http://blog.jdlh.com

JimDeLaHunt
Joomla! Apprentice
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

Postby JimDeLaHunt » Wed Feb 04, 2009 8:08 am

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:
  • 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 *.

I hope this saves someone the several hours I spent diagnosing this error message. Enjoy!
Jim DeLaHunt, multilingual website consultant (jdlh.com), Vancouver, Canada. http://blog.jdlh.com

User avatar
gold
Joomla! Apprentice
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

Postby gold » Wed Feb 04, 2009 11:14 am

good work, thanks so much!

JimDeLaHunt
Joomla! Apprentice
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

Postby JimDeLaHunt » Mon Feb 09, 2009 7:25 am

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!"
Jim DeLaHunt, multilingual website consultant (jdlh.com), Vancouver, Canada. http://blog.jdlh.com

User avatar
kai920
Joomla! Guru
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

Postby kai920 » Fri Feb 20, 2009 9:48 am

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!

User avatar
RC3 Media
Joomla! Apprentice
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

Postby RC3 Media » Wed Aug 12, 2009 8:32 pm

Great, this works. Thanks
I bring your digital ideas to life.

yosia
Joomla! Apprentice
Joomla! Apprentice
Posts: 9
Joined: Thu Apr 10, 2008 7:30 pm

Re: XML Parsing Error at 1:1. Error 4: Empty document

Postby yosia » Mon Nov 02, 2009 10:21 pm

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.

JimDeLaHunt
Joomla! Apprentice
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

Postby JimDeLaHunt » Mon Nov 02, 2009 10:47 pm

yosia wrote:Can I just delete the ._xxx.xml files from the folders?


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.

Good luck!
--Jim DeLaHunt, Vancouver, Canada. Multilingual Joomla & Drupal website consultant.
Jim DeLaHunt, multilingual website consultant (jdlh.com), Vancouver, Canada. http://blog.jdlh.com

seeumee
Joomla! Apprentice
Joomla! Apprentice
Posts: 13
Joined: Fri Jun 26, 2009 4:50 am

Re: XML Parsing Error at 1:1. Error 4: Empty document

Postby seeumee » Thu Nov 05, 2009 7:21 am

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

JimDeLaHunt
Joomla! Apprentice
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

Postby JimDeLaHunt » Thu Nov 05, 2009 8:25 am

seeumee wrote:m also getting the same error....."XML Parsing Error at 1:1. Error 4: Empty document"....
is this any serious matter.....?


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.

--Jim DeLaHunt, Vancouver, Canada. Multilingual Joomla & Drupal website consultant.
Jim DeLaHunt, multilingual website consultant (jdlh.com), Vancouver, Canada. http://blog.jdlh.com

snikan
Joomla! Fledgling
Joomla! Fledgling
Posts: 2
Joined: Thu Jan 14, 2010 4:48 am

Re: XML Parsing Error at 1:1. Error 4: Empty document

Postby snikan » Thu Jan 14, 2010 12:08 pm

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.

User avatar
mediaguru
Joomla! Enthusiast
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

Postby mediaguru » Wed Aug 24, 2011 1:43 pm

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.


Return to “Templates for Joomla! 1.5”

Who is online

Users browsing this forum: No registered users and 5 guests