Baccou Bonneville Blogs Eclipse Blog Process Improvement Blog Java Blog Web Design Blog Miscellaneous .NET Blog

08/20/05

English (US)   Google Sitemaps Stylesheet  -  Categories: XSLT, SEO  -  @ 01:40:47 am
Sitemaps

I'm happy to present Google Sitemaps Stylesheet (GSStylesheet), a XSLT stylesheet named gss.xsl. The stylesheet has been created by Baccou Bonneville and others to display sitemaps XML files in a user-friendly way. You can also check that the URLs in your sitemaps are working. Thanks to Johannes Mueller, sorting is also available for sitmap files.

Here is a demo of Google Sitemaps Stylesheets for Baccou Bonneville web site. It works with IE and Firefox.

[More:]

You have first to download the gss.zip file under Google Sitemaps Toolbox SourceForge.net project.

The content of the zip file (the stylesheet, the CSS and the Javascript files) must be put on your server (for security reasons, Mozilla wants the XML and the XSLT styleshets to be from the same domain).

To use the stylesheets, just add the following lines to your sitemap index and/or sitemap file after the <?xml version="1.0" encoding="UTF-8"?> line:
<?xml-stylesheet type="text/xsl" href="gss.xsl"?>

For Firefox, the MIME type for XSL has to be configured on the server (in your .htaccess file or httpd.conf):
AddType application/xml .xsl

You can tell me what you think about Google Sitemaps Stylesheets by leaving a comment on this note.

Google Sitemaps Stylesheets is available under the terms of the GNU Lesser General Public License (GNU/LPL).

61 comments

Comments:

Comment from: Alice [Visitor] · http://www.margaritasandmadhatters.com/teatime
This looks great on IE. But on Firefox (running on XP), I get an error:

"Error loading stylesheet: An XSLT stylesheet does not have an XML mimetype:http://www.baccoubonneville.com/siteindex.xsl"

PermalinkPermalink 08/20/05 @ 02:19
Comment from: Serge Baccou [Member] Email · http://www.baccoubonneville.com
Ok, it is solved. Thanks you for your comment.

Several problems were there:
1) The MIME type for XSL has to be configured on the server:
AddType application/xml .xsl

2) Firefox does not support document.write() JavaScript calls during XSLT transformations. I have commented these calls.

3) For security reasons, Mozilla wants the XML and the XSLT styleshets to be from the same domain. I have not done the test with different domains, but you will probably have to copy the XSLT stylesheets on your server.
PermalinkPermalink 08/20/05 @ 04:13
Comment from: Tobias Kluge [Visitor] · http://enarion.net/google/
This is wonderful!!!
What licence is your code? Could it be used and integrated by other projects?

Best regards - and thanks for this well-done work!
Tobias
PermalinkPermalink 08/20/05 @ 07:19
Comment from: Serge Baccou [Member] Email · http://www.baccoubonneville.com
Google Sitemaps Stylesheets is available under the terms of the GNU Lesser General Public License (GNU/LPL).

Reminder about this license:
- Copyright notice must be attached
- You can modify the code
- You can create derivative works
- You can ask money for your derivative works
- You can distribute your works in binary
PermalinkPermalink 08/20/05 @ 13:34
Comment from: charco [Visitor] · http://ibchem.com
I tried you file addition but get the error...
Access is denied. Error processing resource 'http://www.baccoubonneville.com/siteindex.xsl'.

what am I doing wrong :(
PermalinkPermalink 08/20/05 @ 14:54
Comment from: Serge Baccou [Member] Email · http://www.baccoubonneville.com
Are you using Firefox? For security reasons, Mozilla wants the XML and the XSLT styleshets to be from the same domain. So, you have to copy the stylesheets on your server and to put the following references:

1) For your Google sitemap index file, add the following line:
<?xml-stylesheet type="text/xsl" href="siteindex.xsl"?>

2) For your Googles sitemap files, add the following line:
<?xml-stylesheet type="text/xsl" href="sitemap.xsl"?>

I will update my note.
PermalinkPermalink 08/20/05 @ 15:00
Comment from: charco [Visitor] · http://ibchem.com
Hi Serge - rapid reply!

no, I'm using IE6.0 in WInXP sp2.
My server is UNIX

charco
PermalinkPermalink 08/20/05 @ 15:03
Comment from: charco [Visitor] · http://ibchem.com
another question...

What is the advantage (or reason for) more than one sitemap on a site?
PermalinkPermalink 08/20/05 @ 15:04
Comment from: charco [Visitor] · http://ibchem.com
and what is the difference between "siteindex" and "sitemap"???
PermalinkPermalink 08/20/05 @ 15:08
Comment from: Serge Baccou [Member] Email · http://www.baccoubonneville.com
Advantage of several sitemaps:
- Current reason: handled by hand for the moment. It will changed ASAP.
- Human readability for controls by the webmaster
- Google recommends to use several sitemaps if we anticipate the sitemap growing beyond 50,000 URLs or 10MB
PermalinkPermalink 08/20/05 @ 15:14
Comment from: Serge Baccou [Member] Email · http://www.baccoubonneville.com
Difference between "siteindex" and "sitemap":

siteindex: list of several sitemaps
sitemap: list of several URLs of your web site.
PermalinkPermalink 08/20/05 @ 15:15
Comment from: Serge Baccou [Member] Email · http://www.baccoubonneville.com
Charco,

Is it working now with a local copy of the stylesheets on your server and a use of the local copies in the xml-stylesheet command?

Can you see properly the demo on Baccou Bonneville web site?
http://www.baccoubonneville.com/sitemap.xml
PermalinkPermalink 08/20/05 @ 15:18
Comment from: Tobias Kluge [Visitor] · http://enarion.net/google/
Hi Serge!

This is wonderful, I'll integrate this into the upcomming phpSitemapNG "kiting" release!

Am I allowed to remove your logo that you've added to the upper right corner? There are some stylesheet problems with the logos and text - the images are over the text, so it's hard to read them.

Best regards,
Tobias
PermalinkPermalink 08/20/05 @ 17:08
Comment from: Serge Baccou [Member] Email · http://www.baccoubonneville.com
Hi Tobias,

I have removed the Baccou Bonneville logo and simplify that part (the CSS file is no longer necessary).

I'm happy to see that you like it.

Serge.
PermalinkPermalink 08/20/05 @ 17:35
Comment from: Tobias Kluge [Visitor] · http://enarion.net/google/
Just another thing: The last modification date in the sitemaps index page is not what it should be:

2005-19-08 is not valid, this should be 2005-08-19

This is fine with the normal sitemaps.

Greetings from Karlsruhe to France,
Tobias
PermalinkPermalink 08/20/05 @ 17:57
Comment from: Serge Baccou [Member] Email · http://www.baccoubonneville.com
Ok, Tobias, I have corrected my dates. Thank you.

Karlsruhe to Strasbourg, it's not so far...
PermalinkPermalink 08/20/05 @ 19:14
Comment from: Johannes Mueller [Visitor] · http://johannesmueller.com/gs/
Bonsoir Serge! (that's about the extent of my french :-))

Just to complete the tour-d'europe, I did a swiss version of your style sheet. I've actually been waiting for a style sheet, it's a wonder nobody else has done one, thanks!

Here's my version / variation (with a sample file, just for the sitemap-file, index-files would be similar):
http://gsitecrawler.com/articles/xsl1/sample.xml
and the files themselves:
http://gsitecrawler.com/articles/xsl1/gs-jm.xsl
http://gsitecrawler.com/articles/xsl1/gs-jm.css
http://gsitecrawler.com/articles/xsl1/gs-jm.js

Some of the things I did:
- add client-side sorting of the data via javascript
- clean up some css, other small stuff

Greetings from close to Zürich,
John
PermalinkPermalink 08/21/05 @ 00:59
Comment from: Johannes Mueller [Visitor] · http://johannesmueller.com/gs/
Yes, I'll release it also under LGPL, I'll add the information in the file tomorrow.

"... because it also works with Firefox"? I'm impressed that it also works in the Internet Explorer :-))). I only tried it in IE6 and FF, so I'm not sure how it will handle in Opera + co. but I imagine it will also work there as well. I'm not sure about Tobias's comment regarding the images, I at least didn't notice any problems, but I know he's more experienced with xml/xsl than I will ever be.

Perhaps a good idea would be to concentrate it all (CSS + JS) into the XSL template. I imagine that should work and cause less problems.

Do you see any way to keep the current version on a central server for Firefox? It would be great to be able to do that (everyone could have a current-version instead of the old version they downloaded), but I know that FF regards that as a security issue... Perhaps server-based? Tobias, do you have some time leftover? :D
PermalinkPermalink 08/21/05 @ 23:50
Comment from: charco [Visitor] · http://ibchem.com
still not working...

I have uploaded the sitemap.xml file to my css folder (at http://ibchem.com/css) I have inclued the line that you have written above... as the second line of my sitemap.xml file but I keep getting the error..
The XML page cannot be displayed
Cannot view XML input using XSL style sheet. Please correct the error and then click the Refresh button, or try again later.


--------------------------------------------------------------------------------

The stylesheet does not contain a document element. The stylesheet may be empty, or it may not be a well-formed XML documen...

any ideas??
PermalinkPermalink 08/22/05 @ 01:29
Comment from: charco [Visitor] · http://ibchem.com
here is my full code...




http://www.ibchem.com/sitemap_1.xml.gz
2005-08-20T12:28:19+00:00

PermalinkPermalink 08/22/05 @ 01:32
Comment from: John Mueller [Visitor] · http://johannesmueller.com/gs/
Hi Charco
Two things:

1) the xsl file (+ css if still needed) MUST be in the SAME directory as the sitemap file. It can't be in /css, it must be in /.

2) It won't work for compressed sitemap files (.xml.gz) - you need to keep an uncompressed version to make sure it works. You can however, still just submit the compressed version to google, the uncompressed version is only for viewing it yourself (or easier: copy the files locally into a directory on your PC instead of the server)

Hope it helped :-)
PermalinkPermalink 08/22/05 @ 09:28
Comment from: Charco [Visitor] · http://ibchem.com
I have also tried the two files in the root directory with the same problem...
PermalinkPermalink 08/22/05 @ 10:51
Comment from: Tobias Kluge [Visitor] · http://enarion.net/google/
Hi @ all!

There is a initial version that needs only one xsl - file.

You can download it here - also LGPL. :)

http://enarion.net/download/google/sitemaps/gss-1.2.zip

Tobias
Open: add css and js into xslt script so that only one file is needed
Cleanup in new gss.xsl file
PermalinkPermalink 08/22/05 @ 16:26
Comment from: Serge Baccou [Member] Email · http://www.baccoubonneville.com
Hello Tobias. Thank you for your work. I have done the cleanup in the gss.xsl file.

I'm not sure it is a good idea to put everything (CSS and JavaScript) into the XSLT file. Especially, we will have some troubles with & characters used in the gss.js and that should be encoded as &amp; in gss.xsl. We will loose readability.

Open: add sorting for siteindex.
PermalinkPermalink 08/22/05 @ 22:37
Comment from: Serge Baccou [Member] Email · http://www.baccoubonneville.com
Charco,

Your 'http://www.ibchem.com/sitemap/sitemap.xsl' file is not valid. It contains a lot of '-' characters due to a save from IE I guess.

You should take the new gss.xsl file from here:
http://www.baccoubonneville.com/gss.xsl but use right click "Save target under..." to save the file properly.

You should be able to see the file by typing 'http://www.ibchem.com/sitemap/sitemap.xsl' in - let say - IE.
PermalinkPermalink 08/23/05 @ 00:33
Comment from: Tobias Kluge [Visitor] · http://enarion.net/google/
Hi Serge,

wow - thanks again for your work! Looks great now! :)

Best regards,
Tobias
PermalinkPermalink 08/23/05 @ 10:56
Comment from: Serge Baccou [Member] Email · http://www.baccoubonneville.com
Hi guys,

Google Sitemaps Stylesheet is now under sourceForge.net: http://sourceforge.net/projects/gstoolbox/. Of course, you can join if you want! I will put the source code under CVS ASAP.
PermalinkPermalink 08/23/05 @ 16:15
Comment from: Serge Baccou [Member] Email · http://www.baccoubonneville.com
Code is available under CVS on SourceForge.net: http://sourceforge.net/cvs/?group_id=146526.
PermalinkPermalink 08/25/05 @ 09:28
Comment from: Tobias Kluge [Visitor] · http://enarion.net/google/
Hi Serge!

I updated a new version into the sf cvs: now the js and the css is integrated into the stylesheet file.

Best regards,
Tobias
PermalinkPermalink 08/27/05 @ 08:36
Comment from: Serge Baccou [Member] Email · http://www.baccoubonneville.com
Hi Tobias.

Thank you. Your usage of CDATA is great. I have a little regression on the logo that does not appear anymore. Any reason?
PermalinkPermalink 08/27/05 @ 11:19
Comment from: Tobias Kluge [Visitor] · http://enarion.net/google/
I could see the logo, and the H1 - title was too big (but this might be related to -at this point- not found css file. You can just add this.

I wrote some documentation about this with screenshots and a installation description - see http://enarion.net/google/sitemaps/stylesheet/

Tobias
PermalinkPermalink 08/27/05 @ 11:30
Comment from: Tobias Kluge [Visitor] · http://enarion.net/google/
Oh sorry. I meant I couldn't see the logo.
PermalinkPermalink 08/27/05 @ 12:01
Comment from: Serge Baccou [Member] Email · http://www.baccoubonneville.com
I have done the change about the logo. It's working for my demo.

I have seen your documentation. It's clear. Can I reproduce the documentation on http://gstoolbox.sourceforge.net/, (not yet available) the official home page of the project?

Another suggestion, we should use the SourceForge project forum http://sourceforge.net/forum/?group_id=146526 instead of this blog or your forum, what do you think?
PermalinkPermalink 08/27/05 @ 13:04
Comment from: Tobias Kluge [Visitor] · http://enarion.net/google/
Hi Serge!

Yeah, you can if you want. Should I release this documentation under a free documentation license? Do you know a good?
I'll use the SF forum up from now, this is a good idea. :)

Best regards,
Tobias
PermalinkPermalink 08/27/05 @ 14:15
Comment from: Serge Baccou [Member] Email · http://www.baccoubonneville.com
I have answered on the SF forum :-).
PermalinkPermalink 08/27/05 @ 15:50
Comment from: Tobias Kluge [Visitor] · http://enarion.net/google/
Me, too. :)
PermalinkPermalink 08/27/05 @ 20:17
Comment from: yvo [Visitor]
great! been looking for this. thanks.
PermalinkPermalink 10/13/05 @ 21:08
Comment from: arturo [Visitor] · http://www.eabarcelona.com
What licence is your code?
PermalinkPermalink 11/05/05 @ 12:02
Comment from: Serge Baccou [Member] Email · http://www.baccoubonneville.com
Google Sitemaps Stylesheet is released under LGPL.
PermalinkPermalink 11/06/05 @ 10:26
Comment from: Jonathan [Visitor] · http://www.lunastoria.nl
Great stylesheet for Google sitemaps! Does not work in Opera 8.5 though, but maybe that's more Opera's problem than yours.
PermalinkPermalink 11/12/05 @ 21:36
Comment from: Kerry Greebing [Visitor] · http://www.diseaseeducation.com
I uploaded an XML sitemap to my site. Is this beneficial to all search engines or just google?
PermalinkPermalink 02/26/06 @ 18:04
Comment from: admin [Member] Email · www.baccoubonneville.com
XML sitemaps are only useful for Google.
PermalinkPermalink 02/27/06 @ 08:19
Comment from: George [Visitor] Email · http://ccsd89.org/1AV/ptc/avptc.htm
I was wondering if there have been any updates to the download file.

The link leads to ver 1.4 and not 1.5

Also once downloaded, a web page appears, but none of my links show in the output.
PermalinkPermalink 10/26/06 @ 00:44
Comment from: Serge Baccou [Member] Email · http://www.baccoubonneville.com
Download is available using SourceForge.net (follow the link in the article). Current downloadable version is 1.4. No new version has been published for a while.
PermalinkPermalink 10/26/06 @ 07:04
Comment from: James [Visitor] Email · http://thatsnowsthegoat.com
I'm using v3, and the formatting from http://sourceforge.net/project/showfiles.php?group_id=146526&package_id=161545&release_id=351493
and put it together as a zip at
http://thatsnowsthegoat.com/wp-content/uploads/sitemap-3.0b1.wp2_human_readable.zip

You can see how it looks at http://thatsnowsthegoat.com/sitemap.xml
PermalinkPermalink 11/13/06 @ 20:10
Comment from: John [Visitor] Email · http://gsitecrawler.com/
I have a newer version of the file online at http://gsitecrawler.com/gss.xsl -- it uses the new sitemaps.org 0.9 namespace (the wrong namespace will lead to an empty listing).

Maybe I should check it in on SourceForge :-)
PermalinkPermalink 12/10/06 @ 19:12
Comment from: Serge Baccou [Member] Email · http://www.baccoubonneville.com
Yes, please.

Tell me if you need an authorization on SourceForge.
PermalinkPermalink 12/10/06 @ 19:16
Comment from: Jackson [Visitor] Email · http://www.osfinance.net
this xsl looks great. a good way for "humans" to read a google sitemap. thank you for developing.
PermalinkPermalink 02/09/07 @ 08:38
Comment from: Rob [Visitor] Email · http://www.datarax.co.uk/
Went to Google and got bored trying to workout how to add a site map. Found gsitecrawler and it was a doddle! Thanks for great,free sitemap software.
PermalinkPermalink 02/27/07 @ 20:09
Comment from: Richard [Visitor] Email · http://www.remote-cron.com
Does anyone know what this means and why I may be getting this error message:

XML Parsing Error: xml declaration not at start of external entity

Thanks in advance.
PermalinkPermalink 03/14/07 @ 21:37
Comment from: Louis [Visitor] Email · http://www.digitalfactory.co.cr
I would like to construct an XML DTD to create an external entity reference in an attribute value. Anyone who could explain me how and if thats possible
PermalinkPermalink 03/15/07 @ 23:13
Comment from: Eduardo [Visitor] Email · http://www.lori-sa.com/
Why are XML sitemaps only usefull with google?
What about Yahoo, MSN, Altavista etc.???
PermalinkPermalink 03/16/07 @ 01:46
Comment from: Bamm Gabriana [Visitor] Email · http://www.pyxis.astronomy.com.ph/
Would it be possible to make the sitemap output XHTML instead of HTML? I tried using the following:

<xsl:output method="xml" doctype-system="http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd" doctype-public="-//W3C//DTD XHTML 1.1//EN" indent="yes"/>

instead of the default:

<xsl:output method="html" version="1.0" encoding="iso-8859-1" indent="yes"/>

on my site but for some reason this messes up the table structure. What needs to be done to get this change to work?

Also, the copyright notice was layed out using tables. I think it is more appropriate to use CSS to create a centered div instead.

Lastly, your table headers are given as a <td> with a classname "header". I think it might be better to use the <th> tag instead, because that's what it's for.
PermalinkPermalink 05/29/07 @ 08:18
Comment from: KVeil [Visitor] Email · http://www.HL7.com.au
I believe Yahoo and - maybe - MS are now also reading sitemaps. Would it be possible to do an updated version of gss.xsl which is Google-independent? In particular not using the Google css reference (http://www.google.com/webmasters/sitemaps/docs/sitemaps.css") and the generic http://www.sitemaps.org/schemas/sitemap/0.9 definition.

Many thanks and Greetings from Sydney.

Klaus
PermalinkPermalink 09/08/07 @ 04:08
Comment from: Darren Oh [Visitor] Email
The Google css file no longer exists. An alternative is available: http://cvs.drupal.org/viewvc.py/drupal/contributions/modules/gsitemap/gss/gss.css?revision=1.1.4.3&content-type=text%2Fplain&pathrev=DRUPAL-5--2
PermalinkPermalink 11/01/07 @ 16:58
Comment from: Jigar Shah [Visitor] Email · http://jigarshahonline.com
Can i add this in my existing html page ?
PermalinkPermalink 12/03/07 @ 16:08
Comment from: admin [Member] Email · www.baccoubonneville.com
Yes
PermalinkPermalink 12/03/07 @ 18:15
Comment from: DarkWolf [Visitor] Email · http://darkwolf.altervista.org
Hi!
I have test to install release 1.4 but i have received some error, for this reason i have test to install 1.5beta and now work fine! :-)
Really compliment for this great work and sorry for my bad english :-(
I have also download and save to my server css file from: http://cvs.drupal.org/viewvc.py/drupal/contributions/modules/gsitemap/gss/gss.css?revision=1.1.4.3&content-type=text%2Fplain&pathrev=DRUPAL-5--2
(and i have edit gss.xsl to point to new css) and now all work perfectly!
Test: http://darkwolf.altervista.org/sitemap.xml
PermalinkPermalink 02/16/08 @ 22:56
Comment from: DarkWolf [Visitor] Email · http://darkwolf.altervista.org
New questions!
now i have make a siteindex (like this of this site) and i have installed and edit wordpress plugin to update and maintain blog_sitemap.xml.
All is perfect but:
1: Can i send all my sitemap and also siteindex to google webmaster tool?
2: Can i insert all sitemap (and also siteindex) to robots.txt?
-
This is my actually robots: http://darkwolf.altervista.org/robots.txt
And this is structure of google sitemap tools:
blog_sitemap.xml - forum_sitemap.xml - index_sitemap.xml - pyg_sitemap.xml - rtech_sitemap.xml - sitemap.xml
Is ok?
thanks in advance :)
PermalinkPermalink 02/18/08 @ 14:12
Comment from: DarkWolf [Visitor] Email · http://darkwolf.altervista.org
I have verified (thanks to google webmaster tools) that only site_index is sufficient to view all other sitemap ;)
Thanks again :)
PermalinkPermalink 02/26/08 @ 02:29
Comment from: Avinash [Visitor] Email · http://www.virtusolutions.co.in
Thanks i have verified it, should i add this in all pages or only in index page
PermalinkPermalink 04/01/08 @ 07:55

Leave a comment:

Your email address will not be displayed on this site.
Your URL will be displayed.

Allowed XHTML tags: <p, ul, ol, li, dl, dt, dd, address, blockquote, ins, del, span, bdo, br, em, strong, dfn, code, samp, kdb, var, cite, abbr, acronym, q, sub, sup, tt, i, b, big, small>
(Line breaks become <br />)
(Set cookies for name, email and url)
(Allow users to contact you through a message form (your email will NOT be displayed.))
This is a captcha-picture. It is used to prevent mass-access by robots.

Please enter the characters from the image above. (case insensitive)

Pingbacks:

No Pingbacks for this post yet...

powered by
b2evolution

Credits: blog software | web hosting | monetize