While working to re-build a site formerly used joomla 1.0, I had a little trouble in the control panel of the new 1.5, because I was leaving an error message.
Fortunately it was not fatal, since it could also modify the site parameters without much inconvenience. But it is not comfortable to see that something is not right, except for a large system such as Joomla.
The error indicated that I had an XML file that was not being parsed properly, but it’s not saying which file or which was wrong.
Then I downloaded a backup of the site, and replicate it on my local machine to find out the error. I remembered that there are thousands of Linux applications for console enough powerful to parse and validate the XML’s from my site.
I had an enjoyable experience with the find command. But I was missing the command to validate an xml file. Searching the web, I found that possibly the command xmllint I could. But ultimately did not help, this reveals a small unexpected detail.
xmllint has an option to validate, but to do this work, requires that 1) the XML file using a defined DTD or 2) it passes a DTD as a parameter. Testing without using a DTD by parameter, I tried the following:
find. -name "*.xml" -exec xmllint --noout --valid "{}" \;
Unfortunately, the result was not what I expected. ALL XML files except one, were invalid because they didn’t have defined the DTD. Thanks to that file that it was, I found that joomla has on its site a DTD file so that developers include it in yours XML configuration files. In this way, the developer requires that your XML files have the structure that the system requires.
The worst… that single valid file, was a third-party plugin and not the official developers. That is, the official joomla developers do not respect their own rules when writing code.
Finally, xmllint was not what I was looking for, and only had to check the file was malformed (bad labels closed nested bad …). As I did not know, see on a mailing list (the one I have in the list of FOSS Communities), where I got the solution: xmlwf.
Just change the above command with the following matter and fixed:
find. -name "*.xml"-exec xmlwf "{}" \;
I found the causers (they were 2), which I fixed and gave the matter ended.
But I stayed with the bitter taste of the disregard that the Joomla developers as a mere detail. What gives me confidence for when a new system update?
