Shopping Basket

 x 

Cart empty


Log In

Find Us Elsewhere

SSL

Forum Search

Keyword

GoogleBaseXml don't show xml correctly in Chrome

  • peterson.gomes
  • peterson.gomes's Avatar Topic Author
  • Offline
  • Fresh Boarder
  • Fresh Boarder
  • IT Architect
More
3 years 5 months ago - 3 years 5 months ago #3623 by peterson.gomes
GoogleBaseXml don't show xml correctly in Chrome was created by peterson.gomes
Hello
I had a problem in the validation of "merchants.google.com > Feeds" because the xml generated through the url, showed the xml text mode,
url sample: www.site.com//index.php?option=com_googl...exml&format=xml&id=1

Add the header attribute to force the google chrome to interpret correctly and it worked.
Virtuemart: 3.0.9
Joomla: Joomla! 3.4.1
PHP: 5.5.9-1ubuntu4.14
File: components / com_googlebasexml / views / googlebasexml / view.xml.php
Line: 306
code:
...
else
{
/ ** Add this Fix before return xml * /
header ( "Content-Type: text / xml; charset = utf-8", true);
echo $ xml;
}
...
/
This issue has been identified? There is already an official fix for plungin?

Best regards
Last edit: 3 years 5 months ago by peterson.gomes.

Please Log in or Create an account to join the conversation.

More
3 years 5 months ago #3624 by boggler
It should not be necessary, the view.xml.php file already includes this:-
	   //create xml document
          $document = JFactory::getDocument();
	   $document->setType('xml');

which automatically sets the mime-type to 'application/xml' which is the correct mime-type. However when I tested myself you are correct that the content-type header is being sent as text/html, it seems that this is a Joomla bug. We will put something in to force the correct content-type header, thanks for letting us know.

Please Log in or Create an account to join the conversation.

More
3 years 5 months ago #3625 by boggler
It seems that the Joomla document renderer is broken when it comes to XML, the only solution which works is the one you suggest, to force the content type header, however I think that application/xml is better than text/xml for the content type header. text/xml works in chrome but not in some other browsers, whereas application/xml seems to be accepted by all modern browsers:-
header ( "Content-Type: application/ xml; charset = utf-8", true);

Please Log in or Create an account to join the conversation.

  • peterson.gomes
  • peterson.gomes's Avatar Topic Author
  • Offline
  • Fresh Boarder
  • Fresh Boarder
  • IT Architect
More
3 years 5 months ago #3626 by peterson.gomes
Replied by peterson.gomes on topic GoogleBaseXml don't show xml correctly in Chrome
Yes, but to return the xml in the browser, the content type should be "text / xml", if I am using "application / xml" the browser does download the xml file.
Anyway I'm testing the two formats on Google Merchant Feed configuration and I will be post the results.

Reference: www.w3schools.com/xml/xml_server.asp

Please Log in or Create an account to join the conversation.

More
3 years 5 months ago #3627 by boggler
Both text/xml and application/xml are correct, see https://en.wikipedia.org/wiki/XML_and_MIME and can be used more or less interchangeably.

My recommendation to use application/xml was based on some experiments which suggested that some browsers seemed to prefer application/xml, I found unlike you that some (for example firefox) would not render text/xml when I tried, whereas all of the ones that I tried, including Chrome, could render application/xml.

Either way it is a minor issue, the content-type header should not in any way prevent Google from being able to read the data feed, and we have no record of anyone ever actually having an issue with this. So far as I know, having the content-type header being rendered as text/html only causes a problem with the display in the Chrome browser, other browsers seem to have no trouble with it, nor does Google merchant centre.
The following user(s) said Thank You: peterson.gomes

Please Log in or Create an account to join the conversation.

  • peterson.gomes
  • peterson.gomes's Avatar Topic Author
  • Offline
  • Fresh Boarder
  • Fresh Boarder
  • IT Architect
More
3 years 5 months ago #3628 by peterson.gomes
Replied by peterson.gomes on topic GoogleBaseXml don't show xml correctly in Chrome
Grateful for the explanation, in fact both ran, but I will keep this recommendation application/xml, the return in browser is fine.

Regarding access to feed, could partially solve with the Google Merchant Center support, what happens is that Google Feed search engine can not access our site domain for a infrastructure blocking, is under analysis technicians. I am using the XML file manually to keep our operational store.

Thank you!

Please Log in or Create an account to join the conversation.

More
3 years 5 months ago #3630 by boggler
We will make a new release in the near future with the fix, it will have an option to choose the content-type depending what is best for your browser.

Please Log in or Create an account to join the conversation.

Moderators: boggler
Time to create page: 0.217 seconds

Donate to Us

If you like our extensions, consider making a donation to say thanks.