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.

All other Modules

Discuss all other Modules here.

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

Google Sitemaps Module Parsing Error


Reply

2 Posts   687 Views

Avatar
airscool

26 March 2013 at 9:56pm (Last edited: 26 March 2013 10:55pm), Community Member, 4 Posts

I have downloaded the latest version of the Google Sitemaps Module and uploaded the unpacked folder (named googlesitemaps) into the www folder.

I have then created a new folder under mysite called _config into which I have placed a file googlesitemaps.yml with the following content:

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

I have succesfully run /dev/build and rebuilt the database but upon visiting www.mysite.co.uk/sitemap.xml I get the following error:

XML Parsing Error: mismatched tag. Expected: </base>.
Location: http://www.mysite.co.uk/sitemap.xml
Line Number 11, Column 3:

</head>
--^

Am I missing something?

Addition: I have since attempted to run /dev/build and I now get the following error:

Fatal error: Uncaught exception 'InvalidArgumentException' with message 'Unable to parse line 1 (---).' in /home/ardenhou/public_html/framework/thirdparty/zend_translate_railsyaml/library/Translate/Adapter/thirdparty/sfYaml/lib/sfYamlParser.php:265 Stack trace: #0 /home/ardenhou/public_html/framework/core/manifest/ConfigManifest.php(211): sfYamlParser->parse('???---?Name: cu...') #1 [internal function]: SS_ConfigManifest->addYAMLConfigFile('googlesitemaps....', '/home/ardenhou/...', 2) #2 /home/ardenhou/public_html/framework/filesystem/FileFinder.php(158): call_user_func(Array, 'googlesitemaps....', '/home/ardenhou/...', 2) #3 /home/ardenhou/public_html/framework/core/manifest/ConfigManifest.php(141): SS_FileFinder->find('/home/ardenhou/...') #4 /home/ardenhou/public_html/framework/core/manifest/ConfigManifest.php(75): SS_ConfigManifest->regenerate(false) #5 /home/ardenhou/public_html/framework/core/Core.php(275): SS_ConfigManifest->__construct('/home/ardenhou/...', false, true) #6 /home/ardenhou/public_html/framework/ in /home/ardenhou/public_html/framework/thirdparty/zend_translate_railsyaml/library/Translate/Adapter/thirdparty/sfYaml/lib/sfYamlParser.php on line 265

Avatar
micahsheets

4 June 2013 at 7:23am (Last edited: 4 June 2013 7:26am), Community Member, 164 Posts

Hello,

The dev/build error you are getting is a result of malformed yml code. It must be properly indented so instead of :

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


It should be:

Name: customgooglesitemaps
After: googlesitemaps
---
GoogleSitemap:
<space><space>enabled: true
<space><space>objects_per_sitemap: 1000
<space><space>google_notification_enabled: true
<space><space>use_show_in_search: true

Intents for yml must be 2 spaces. ( here shown as <space><space> since the post strips out the spaces if I put them in.

As far as the missing </base> tag, I am not sure how to fix that as even if I manually put the base tag into my page.ss file so that is has a nice closing tag it does not when rendered by Firefox.

I don't know why firefox does not properly close the <base> or <meta>tags but the xml parser expects closing tags at least on the <base> tag.

I am hoping that the maintainers of the googlesitemaps module can find a solution. One such solution would be to have the controller render the sitemap.xml with a custom template that we could format properly for the sitemap but not affect the rest of the site.