08/20/05
![]() |
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. |
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).
Comments:
"Error loading stylesheet: An XSLT stylesheet does not have an XML mimetype:http://www.baccoubonneville.com/siteindex.xsl"
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.
What licence is your code? Could it be used and integrated by other projects?
Best regards - and thanks for this well-done work!
Tobias
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
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.
no, I'm using IE6.0 in WInXP sp2.
My server is UNIX
charco
What is the advantage (or reason for) more than one sitemap on a site?
- 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
siteindex: list of several sitemaps
sitemap: list of several URLs of your web site.
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
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
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.
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
Karlsruhe to Strasbourg, it's not so far...
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
"... 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
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??
http://www.ibchem.com/sitemap_1.xml.gz
2005-08-20T12:28:19+00:00
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 :-)
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
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 & in gss.xsl. We will loose readability.
Open: add sorting for siteindex.
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.
wow - thanks again for your work! Looks great now! :)
Best regards,
Tobias
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.
I updated a new version into the sf cvs: now the js and the css is integrated into the stylesheet file.
Best regards,
Tobias
Thank you. Your usage of CDATA is great. I have a little regression on the logo that does not appear anymore. Any reason?
I wrote some documentation about this with screenshots and a installation description - see http://enarion.net/google/sitemaps/stylesheet/
Tobias
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?
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
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.
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
Maybe I should check it in on SourceForge :-)
Tell me if you need an authorization on SourceForge.
XML Parsing Error: xml declaration not at start of external entity
Thanks in advance.
What about Yahoo, MSN, Altavista etc.???
<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.
Many thanks and Greetings from Sydney.
Klaus
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
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 :)
Thanks again :)
This post has 2 feedbacks awaiting moderation...
Leave a comment:
Pingbacks:
No Pingbacks for this post yet...
This post has 2 feedbacks awaiting moderation...
