Search

I'm trying to create a Google News Sitemap compliant XML file for a site but keep running into XSLT Processing Errors it seems for using colons inside tags. Have googled extensively but been unable to figure out how to get around this. Does anyone have any ideas?

Problems occur when I create tags such as:

<xsl:attribute name="xmlns:news">http://www.google.com/schemas/sitemap-news/0.9</xsl:attribute>

or

<news:publication>
    <news:name>The Example Times</news:name>
    <news:language>en</news:language>
</news:publication>

You will need to add the appropriate namespaces to your XSLT to be able to reference and use: news:name etc....

Try adding these to your xsl:stylesheet line at the top:

xmlns="http://www.sitemaps.org/schemas/sitemap/0.9" xmlns:news="http://www.google.com/schemas/sitemap-news/0.9"

You should read about namespaces. There are many good threads here about this topic!

[EDIT]: Ah, @muthahubbard beat me!

Thanks so much - that's worked a charm

Create an account or sign in to comment.

Symphony • Open Source XSLT CMS

Server Requirements

  • PHP 5.3-5.6 or 7.0-7.3
  • PHP's LibXML module, with the XSLT extension enabled (--with-xsl)
  • MySQL 5.5 or above
  • An Apache or Litespeed webserver
  • Apache's mod_rewrite module or equivalent

Compatible Hosts

Sign in

Login details