Skip to main content

This site requires you to update your browser. Your browsing experience maybe affected by not having the most up to date version.

We've moved the forum!

Please use forum.silverstripe.org for any new questions (announcement).
The forum archive will stick around, but will be read only.

You can also use our Slack channel or StackOverflow to ask for help.
Check out our community overview for more options to contribute.

General Questions /

General questions about getting started with SilverStripe that don't fit in any of the categories above.

Moderators: martimiz, Sean, Ed, biapar, Willr, Ingo, swaiba

googlesitemaps sitmap.xml XML Parsing Error


Go to End


2 Posts   1517 Views

Avatar
merrick_sd

Community Member, 99 Posts

4 October 2014 at 2:55am

i a have ss3.1.6 installed.

i have "silverstripe/googlesitemaps": "dev-master" in my composer file etc

composer update

and i've setup mysite > _config > googlesitemaps.yml

---
Name: customgooglesitemaps
After: googlesitemaps
---
GoogleSitemap:
enabled: true
objects_per_sitemap: 1000
google_notification_enabled: false
use_show_in_search: true

when i go to http://dev.mytestdomain.com/sitmap.xml i get

XML Parsing Error: XML or text declaration not at start of entity
Location: http://dev.mytestdomain.com/sitemap.xml
Line Number 3, Column 1:
<?xml version="1.0" encoding="UTF-8"?>
Is there a good way of figuring out what is causing this?

I have done view source
lines 1 and 2 are blank

line 1
line 2
line 3 <?xml version="1.0" encoding="UTF-8"?>
line 4 <?xml-stylesheet type='text/xsl' href='http://dev.mytestdomain.com/googlesitemaps/templates/xml-sitemapindex.xsl'?>
line 5 <sitemapindex xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
line 6 <sitemap>
line 7 <loc>http://dev.mytestdomain.com/sitemap.xml/sitemap/SiteTree/1</loc>;
line 8 <lastmod>2014-10-03</lastmod>
line 9 </sitemap>
line 10 </sitemapindex>

Where is the blank line coming from in the xml file . i don't have closing ?> php in any of my code

and visiting http://dev.mytestdomain.com/sitemap.xml/sitemap/SiteTree/1

again get error with 2 blank line in source code and then
line1
line2
line3: <?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type='text/xsl' href='http://dev.mytestdomain.com/googlesitemaps/templates/xml-sitemap.xsl'?>
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">

<url>
<loc>http://dev.mytestdomain.com/internet-services/email-spam-and-antivirus-protection/</loc>;
<lastmod>2014-06-12T12:15:28+01:00</lastmod>
<changefreq>monthly</changefreq>
<priority>1.0</priority>
</url>

<url>
<loc>http://dev.mytestdomain.com/internet-services/help/email/</loc>;
<lastmod>2014-10-03T10:28:32+01:00</lastmod>
<changefreq>monthly</changefreq>
<priority>0.8</priority>
</url>

<url>
<loc>http://dev.mytestdomain.com/</loc>;
<lastmod>2014-10-03T10:28:31+01:00</lastmod>
<changefreq>weekly</changefreq>
<priority>1.0</priority>
</url>

<url>
<loc>http://dev.mytestdomain.com/internet-services/help/email/iphone/</loc>;
<lastmod>2012-04-25T15:28:51+01:00</lastmod>
<changefreq>monthly</changefreq>
<priority>0.7</priority>
</url>

<url>
<loc>http://dev.mytestdomain.com/internet-services/help/email/mac-osx-mail-app/</loc>;
<lastmod>2014-03-26T11:01:45+00:00</lastmod>
<changefreq>monthly</changefreq>
<priority>0.7</priority>
</url>

<url>
<loc>http://dev.mytestdomain.com/internet-services/</loc>;
<lastmod>2014-05-29T08:44:45+01:00</lastmod>
<changefreq>monthly</changefreq>
<priority>0.9</priority>
</url>

<url>
<loc>http://dev.mytestdomain.com/computer-services/</loc>;
<lastmod>2014-04-28T15:27:25+01:00</lastmod>
<changefreq>monthly</changefreq>
<priority>0.9</priority>
</url>

<url>
<loc>http://dev.mytestdomain.com/internet-services/</loc>;
<lastmod>2014-05-29T08:44:45+01:00</lastmod>
<changefreq>monthly</changefreq>
<priority>1.0</priority>
</url>

<url>
<loc>http://dev.mytestdomain.com/computer-services/maintenance-services/</loc>;
<lastmod>2012-01-27T13:13:46+00:00</lastmod>
<changefreq>monthly</changefreq>
<priority>0.9</priority>
</url>

<url>
<loc>http://dev.mytestdomain.com/internet-services/email-spam-and-antivirus-protection/</loc>;
<lastmod>2014-06-12T12:15:28+01:00</lastmod>
<changefreq>monthly</changefreq>
<priority>0.9</priority>
</url>

<url>
<loc>http://dev.mytestdomain.com/internet-services/help/email/mac-osx/</loc>;
<lastmod>2012-04-25T15:28:16+01:00</lastmod>
<changefreq>monthly</changefreq>
<priority>0.7</priority>
</url>

<url>
<loc>http://dev.mytestdomain.com/internet-services/help/email/outlook-express/</loc>;
<lastmod>2014-03-26T11:01:06+00:00</lastmod>
<changefreq>monthly</changefreq>
<priority>0.7</priority>
</url>

<url>
<loc>http://dev.mytestdomain.com/remote/</loc>;
<lastmod>2012-11-15T15:25:01+00:00</lastmod>
<changefreq>monthly</changefreq>
<priority>1.0</priority>
</url>

<url>
<loc>http://dev.mytestdomain.com/computer-services/</loc>;
<lastmod>2011-10-10T10:28:15+01:00</lastmod>
<changefreq>monthly</changefreq>
<priority>1.0</priority>
</url>

<url>
<loc>http://dev.mytestdomain.com/computer-services/it-callout-services/</loc>;
<lastmod>2012-05-01T14:56:29+01:00</lastmod>
<changefreq>monthly</changefreq>
<priority>0.9</priority>
</url>

<url>
<loc>http://dev.mytestdomain.com/internet-services/web-hosting/</loc>;
<lastmod>2010-10-07T11:22:02+01:00</lastmod>
<changefreq>monthly</changefreq>
<priority>0.9</priority>
</url>

<url>
<loc>http://dev.mytestdomain.com/internet-services/help/email/outlook-2007/</loc>;
<lastmod>2014-03-26T11:00:42+00:00</lastmod>
<changefreq>monthly</changefreq>
<priority>0.7</priority>
</url>

<url>
<loc>http://dev.mytestdomain.com/internet-services/help/email/outlook-2010/</loc>;
<lastmod>2014-03-26T10:59:48+00:00</lastmod>
<changefreq>monthly</changefreq>
<priority>0.7</priority>
</url>

<url>
<loc>http://dev.mytestdomain.com/internet-services/help/</loc>;
<lastmod>2014-06-24T14:15:47+01:00</lastmod>
<changefreq>weekly</changefreq>
<priority>0.9</priority>
</url>

<url>
<loc>http://dev.mytestdomain.com/internet-services/help/email/iphone-2/</loc>;
<lastmod>2012-11-21T12:25:54+00:00</lastmod>
<changefreq>weekly</changefreq>
<priority>0.7</priority>
</url>

<url>
<loc>http://dev.mytestdomain.com/contact/</loc>;
<lastmod>2014-06-04T16:56:37+01:00</lastmod>
<changefreq>weekly</changefreq>
<priority>1</priority>
</url>

<url>
<loc>http://dev.mytestdomain.com/ITsupport/</loc>;
<lastmod>2014-06-13T11:56:29+01:00</lastmod>
<changefreq>weekly</changefreq>
<priority>0.9</priority>
</url>

<url>
<loc>http://dev.mytestdomain.com/computer-services/it-support-enquiryform/</loc>;
<lastmod>2014-06-13T11:56:29+01:00</lastmod>
<changefreq>monthly</changefreq>
<priority>1.0</priority>
</url>

<url>
<loc>http://dev.mytestdomain.com/checkout/</loc>;
<lastmod>2012-01-25T16:01:58+00:00</lastmod>
<changefreq>monthly</changefreq>
<priority>1.0</priority>
</url>

<url>
<loc>http://dev.mytestdomain.com/terms-and-conditions/</loc>;
<lastmod>2012-05-28T14:55:41+01:00</lastmod>
<changefreq>monthly</changefreq>
>! <priority>1.0</priority>
</url>

<url>
<loc>http://dev.mytestdomain.com/privacy/</loc>;
<lastmod>2012-06-11T16:52:13+01:00</lastmod>
<changefreq>monthly</changefreq>
<priority>1.0</priority>
</url>

<url>
<loc>http://dev.mytestdomain.com/email-disclaimer/</loc>;
<lastmod>2012-06-18T14:54:57+01:00</lastmod>
<changefreq>monthly</changefreq>
<priority>1.0</priority>
</url>

<url>
<loc>http://dev.mytestdomain.com/invoices/</loc>;
<lastmod>2011-09-08T13:15:23+01:00</lastmod>
<changefreq>monthly</changefreq>
<priority>1.0</priority>
</url>

<url>
<loc>http://dev.mytestdomain.com/account/</loc>;
<lastmod>2014-08-19T16:03:31+01:00</lastmod>
<changefreq>weekly</changefreq>
<priority>1</priority>
</url>

<url>
<loc>http://dev.mytestdomain.com/cart/</loc>;
<lastmod>2014-08-19T10:12:36+01:00</lastmod>
<changefreq>weekly</changefreq>
<priority>1</priority>
</url>

<url>
<loc>http://dev.mytestdomain.com/office-365/</loc>;
<lastmod>2014-09-25T15:53:38+01:00</lastmod>
<changefreq>hourly</changefreq>
<priority>1</priority>
</url>

</urlset>>!

Avatar
martimiz

Forum Moderator, 1391 Posts

9 October 2014 at 4:11am

This is someone having the same problem, who said to have fixed it by removing extra (illegal) whitespace on custom page types:
http://www.silverstripe.org/community/forums/blog-module-forum/show/9158#post281571

And this is another more drastic solution, by changing the doctype to HTML5 that seemed to have fixed the same issue (???):
http://www.silverstripe.org/community/forums/dataobjectmanager-module-forum/show/14924