X-Cart: shopping cart software

X-Cart forums (https://forum.x-cart.com/index.php)
-   Changing design (https://forum.x-cart.com/forumdisplay.php?f=51)
-   -   XML in header for 4.2.1 (https://forum.x-cart.com/showthread.php?t=47808)

steve.thompson 05-28-2009 09:06 PM

XML in header for 4.2.1
 
Hi All.

I was having a problem with my store which was identified by Jon at WebsiteCM as an XML header line in all of my customer pages. I've looked at a few other 4.2.1 sites and they are also showing an xml line at the start of their pages.

It looks like it comes from the skin1/customer/home.tpl file, the first couple of lines look like this:
Code:

{*
$Id: home.tpl,v 1.100 2008/12/11 08:02:53 max Exp $
vim: set ts=2 sw=2 sts=2 et:
*}
{* <?xml version="1.0" encoding="{$default_charset|default:"iso-8859-1"}"?> *}
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
{config_load file="$skin_config"}


Anyone running 4.2.1 ? Display any of your customer pages in your browser then view the source. Do you see
Code:

<?xml version="1.0" encoding="iso-8859-1"?>
as the first line?

This line was in the distribution files from QT. Any experts here? Is the solution to remove the "xml" line from skin1/customer/home.tpl ? Is this a bug?

Thanks, Steve.

pauldodman 05-29-2009 01:55 AM

Re: XML in header for 4.2.1
 
What was the problem you were having?

cflsystems 05-29-2009 05:30 AM

Re: XML in header for 4.2.1
 
I have it and it shows like this on output pages
Code:

<?xml version="1.0" encoding="iso-8859-1"?>
No problems at all, it also validates with w3

balinor 05-29-2009 05:34 AM

Re: XML in header for 4.2.1
 
Moving to the 4.2 template area.

steve.thompson 05-29-2009 01:11 PM

Re: XML in header for 4.2.1
 
I'm using FTS SiteMaps. For sites with a lot of products, it has a cached version for faster display and to reduce server load, by making up an html page. That html page was not displaying. I reported the problem to Jon and here is his reply:
Quote:

Hi Steve,

Your site header is issuing code to tell browsers that the site is an xml document, which it isn't. This is on all pages and really needs to be corrected not just to rectify this sitemap issue, but because it will also cause other errors.

The code in question is attached.

Quote:


<?xml version="1.0" encoding="iso-8859-1"?>


Your template should be edited so that this is not appearing in your source code. Likely this code is coming from skin1/customer/main/home.tpl or from a php file.

Jon Peters



So, seems that you should not have an xml header in an html file. It was appearing in all customer pages, not just the sitemap page.

It seems to be coming from the skin1/customer/home.tpl file. I commented that line out and problem fixed. This line in home.tpl is in the QT distribution file that I received for 4.2.1 so, is this a bug in the QT distributed file?

Steve.

susanhoover 04-16-2010 05:24 AM

Re: XML in header for 4.2.1
 
I got the same error when I put the Google-site-verification line above the xml declaration line. When I moved the Google line down, it worked OK.

JeanB 02-09-2011 02:18 AM

Re: XML in header for 4.2.1
 
Hi All,

Sorry to bump an old topic ...

I've just tried to verify with W3C and it has come up with the error :

Line 2, Column 6: XML declaration allowed only at the start of the document

However, it IS as the start of home.tpl!?

Reading this topic, I wondered what it would do if I removed it from the template.

And my site verifys perfectly now ... ? And there are no loading errors at all?


Is it OK to remove this!!?

cflsystems 02-09-2011 02:51 AM

Re: XML in header for 4.2.1
 
Make sure it is actually as first line of the html doc. No spaces, empty lines or anything else before it

JeanB 02-09-2011 02:54 AM

Re: XML in header for 4.2.1
 
Well, putting it back in, it is definitely at the very, very top of home.tpl.

However, I viewed the source & it is appearing at line 2!


So, what's before it?! :shock:

cflsystems 02-09-2011 02:57 AM

Re: XML in header for 4.2.1
 
Well something is putting a line before it, could be home.php, check the script


All times are GMT -8. The time now is 05:05 AM.

Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.