• Hi,

    I just installed the plugin today, “built” my sitemap, and have received no error messages during either of those activities. However, once I click on the link to my sitemap that shows up under “Status,” I receive the following error message:

    Error loading stylesheet:An XSLT stylesheet does not have an XML mimetype.

    I would appreciate it if someone could help me determine what this problem is and how to solve it. Thanks.

Viewing 5 replies - 1 through 5 (of 5 total)
  • I have the same problem. It results, I believe, from the stylesheet ‘sitemap.xsl’, included with the plug-in, not being recognized for some strange reason I have yet to fathom. In the ‘Advanced’ section of the sitemap plug-in dashboard look for the “Include an XSL stylesheet” textbox. Delete the default URL in there, click ‘Update Options”, then under ‘Status’ click the link ‘rebuild the sitemap manually’. Once the page has reloaded you should be able to view your sitemap, albeit in ‘tree’ form and not nicely laid out as it would be if the stylesheet was functioning. At least you’ll know its working.

    If anyone has sorted this obviously common problem – PLEASE let us know.

    Okay, after much delving I’ve found a solution in the archives, but as it seems a fairly common problem, I’ll repeat it here:

    The stylesheet ‘sitemap.xsl’ located in the Google-Sitemap-Generator directory, requires minor alteration. Open it in a text editor, delete the first line: <?xml version="1.0" encoding="UTF-8"?> and replace it with: `<?xml version=”1.0″ encoding=”UTF-8″?>
    <?xml-stylesheet type=”text/xsl” href=”product-list.xslt”?>`

    Then open your .htaccess file in an editor and insert this: AddType application/xml .xsl

    That solved the problem for me. My thanks to members mrsdiva and npen for pointing me in the right direction.

    NOTE: I didn’t have a .htaccess file. Apparently, it isn’t automatically created when WordPress is downloaded. To create one, open a text editor like Notepad, click on ‘file’ then ‘New’, name the new file htaccess.txt, add the bit of code above and save it to your local WordPress folder. Then upload it to your server and rename it .htaccess

    Finally, go to your WordPress Admin Google-Sitemap-Generator dashboard. In the ‘Advanced Options’ is a text box and a link, ‘Use Default’. Clicking the link will insert the path to your `sitemap.xsl’ file. Scroll down, click ‘Update Options’. Once the page has refreshed, scroll up to the ‘Status’ section (top) and click the link ‘rebuild the sitemap’. It will take a few seconds for the page to refresh, then on the first line in the ‘Status’ section click on the link: ‘sitemap’.

    If all is well, your styled sitemap should magically appear.

    well Ive got a wacky one to add to this pile …

    I followed your instructions and did get a tree version

    which was better that the other mashed version … thank you for that help …

    now when I hit rebulild I getthe tree version at https://mydomain.com/sitemap.xsl …. if I switch the xsl to xml from that page I get a beautiful sitemap … but … if I just type in https://mydomain.com/sitemap.xml from a blank browser I get nothing … blank page
    the only way I can see my “pretty” sitemap is to already be on xsl and the switch the s to an m …

    also I want sure exactly where to put the code

    AddType application/xml .xsl in my existing htaccess. file

    this is what it looks like now

    # BEGIN WordPress
    <IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteBase /
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule . /index.php [L]
    </IfModule>

    # END WordPress

    perhaps where I did put it is in the wrong placethus the “ghosting” xml sitemap appearance …

    I had it
    # BEGIN WordPress
    <IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteBase /
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule . /index.php [L]
    </IfModule>

    AddType application/xml .xsl <——— I put it there originally (then removed it)
    # END WordPress

    I figure the placement of that code is why this is occuring … any suuggestions ?

    tgurl
    I’m not at all sure why you have this problem. I don’t see it matters whether you put AddType application/xml .xsl before or after the other code in the .htaccess file. I can get a sitemap by typing in https://mydomain.com/sitemap.xml . I have nothing else in .htaccess, though.

    Hope you get it sorted.

    capelyddol

    I did what you suggested and I see my tree style sheet. Is this ok to leave like this or is the style sheet needed to work correctly. Please let me know asap.

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘[Plugin: Google XML Sitemaps] Error loading stylesheet’ is closed to new replies.