The Joomla! Forum ™



Forum rules


Forum Rules
Absolute Beginner's Guide to Joomla! <-- please read before posting, this means YOU.



Post new topic Reply to topic  [ 13 posts ] 
Author Message
PostPosted: Sun Dec 28, 2008 7:42 am 
User avatar
Joomla! Apprentice
Joomla! Apprentice

Joined: Tue Nov 04, 2008 1:20 am
Posts: 20
Location: perth
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


Top
 Profile  
 
PostPosted: Tue Feb 03, 2009 10:57 am 
Joomla! Apprentice
Joomla! Apprentice

Joined: Tue May 30, 2006 11:12 pm
Posts: 40
Location: Vancouver, BC
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


Top
 Profile  
 
PostPosted: Wed Feb 04, 2009 8:08 am 
Joomla! Apprentice
Joomla! Apprentice

Joined: Tue May 30, 2006 11:12 pm
Posts: 40
Location: Vancouver, BC
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


Top
 Profile  
 
PostPosted: Wed Feb 04, 2009 11:14 am 
User avatar
Joomla! Apprentice
Joomla! Apprentice

Joined: Tue Nov 04, 2008 1:20 am
Posts: 20
Location: perth
good work, thanks so much!


Top
 Profile  
 
PostPosted: Mon Feb 09, 2009 7:25 am 
Joomla! Apprentice
Joomla! Apprentice

Joined: Tue May 30, 2006 11:12 pm
Posts: 40
Location: Vancouver, BC
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


Top
 Profile  
 
PostPosted: Fri Feb 20, 2009 9:48 am 
User avatar
Joomla! Guru
Joomla! Guru

Joined: Sun Sep 04, 2005 3:59 pm
Posts: 537
Location: Hong Kong
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!


Top
 Profile  
 
PostPosted: Wed Aug 12, 2009 8:32 pm 
User avatar
Joomla! Apprentice
Joomla! Apprentice

Joined: Fri Jul 17, 2009 6:02 pm
Posts: 26
Location: Los Angeles, Ca
Great, this works. Thanks

_________________
I bring your digital ideas to life.


Top
 Profile  
 
PostPosted: Mon Nov 02, 2009 10:21 pm 
Joomla! Apprentice
Joomla! Apprentice

Joined: Thu Apr 10, 2008 7:30 pm
Posts: 9
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.


Top
 Profile  
 
PostPosted: Mon Nov 02, 2009 10:47 pm 
Joomla! Apprentice
Joomla! Apprentice

Joined: Tue May 30, 2006 11:12 pm
Posts: 40
Location: Vancouver, BC
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


Top
 Profile  
 
PostPosted: Thu Nov 05, 2009 7:21 am 
Joomla! Apprentice
Joomla! Apprentice

Joined: Fri Jun 26, 2009 4:50 am
Posts: 13
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


Top
 Profile  
 
PostPosted: Thu Nov 05, 2009 8:25 am 
Joomla! Apprentice
Joomla! Apprentice

Joined: Tue May 30, 2006 11:12 pm
Posts: 40
Location: Vancouver, BC
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


Top
 Profile  
 
PostPosted: Thu Jan 14, 2010 12:08 pm 
Joomla! Fledgling
Joomla! Fledgling

Joined: Thu Jan 14, 2010 4:48 am
Posts: 2
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.


Top
 Profile  
 
PostPosted: Wed Aug 24, 2011 1:43 pm 
User avatar
Joomla! Enthusiast
Joomla! Enthusiast

Joined: Mon Sep 19, 2005 3:56 am
Posts: 142
Location: USA
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.

_________________
http://www.thegolfspace.com
http://www.tkserver.com


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 13 posts ] 



Who is online

Users browsing this forum: No registered users and 26 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Jump to:  
Powered by phpBB® Forum Software © phpBB Group