AdWords is now Google Ads. Our new name reflects the full range of advertising options we offer across Search, Display, YouTube, and more. Learn more

Ads
3.8K members online now
3.8K members online now
For questions related to Google Shopping and Merchant Center. Learn to optimize your Shopping ads
Guide Me
star_border
Reply

XML Formatting Error

Visitor ✭ ✭ ✭
# 1
Visitor ✭ ✭ ✭

Hoping someone can help with this as it's giving me what I call a php headache (almost as bad as a css headache).

 

Our merchant feed was working perfectly until a few days a go when an error started appearing regarding an XML formatting error:

 

Image1.jpg

 

The feed is here:

https://pamelamann.co.uk/fashionnexus/feeds/googlemerchant.php

 

and here is the php code which generated the first part:

// XML HTTP headers
//header('Content-Type: application/xml; charset=utf-8');

// XML content
echo '<?xml version="1.0" encoding="UTF-8"?>'."\r\n";
echo '<feed xmlns="http://www.w3.org/2005/Atom" xmlns:g="http://base.google.com/ns/1.0">'."\r\n";
echo '	<title>Pamela Mann</title>'."\r\n";
echo '	<author>'."\r\n";
echo '		<name>Pamela Mann</name>'."\r\n";
echo '	</author>'."\r\n";
		//die("XX");

The xml feed validates wherever  I check it, but Google in it's infinite wisdom is declaring it as nvalid.

 

Does anyone have any ideas?

 

Thanks

Steve

1 Expert replyverified_user
1 ACCEPTED SOLUTION

Accepted Solutions
Marked as Best Answer.
Solution
Accepted by topic author Stephen H
December 2016

Re: XML Formatting Error

Top Contributor
# 2
Top Contributor

 You have an empty line on line 1.

The xml opening tag must be on the first line, check with your web developer to ensure the php is written correctly.

 

For example the php opening tag might have a space or a row in front, which you can't do

<?php
Twitter | Linkedin | Community Profile | Shopping Feed Tips From FeedArmy
Did you find any helpful responses or answers to your query? If yes, please click on ‘Accept As Solution’

View solution in original post

Marked as Best Answer.
Solution
Accepted by topic author Stephen H
December 2016

Re: XML Formatting Error

Top Contributor
# 2
Top Contributor

 You have an empty line on line 1.

The xml opening tag must be on the first line, check with your web developer to ensure the php is written correctly.

 

For example the php opening tag might have a space or a row in front, which you can't do

<?php
Twitter | Linkedin | Community Profile | Shopping Feed Tips From FeedArmy
Did you find any helpful responses or answers to your query? If yes, please click on ‘Accept As Solution’

XML Formatting Error

Visitor ✭ ✭ ✭
# 3
Visitor ✭ ✭ ✭

You're a star, so simple and so simply missed.

 

Thanks