Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Topic author was deleted

    Sep 19, 2013 @ 11:25

    Google sitemap not accepted

    Hi,

    I have created a sitemap with the standard xlst template but I get the following error when submitting it to google webmastertools:

    Your Sitemap appears to be an HTML page Instead, use a supported sitemap format.

    How can I fix this? I use v6.0.3

    Thnx Bart

  • Alex Skrypnyk 6163 posts 24143 karma points MVP 8x admin c-trib
    Sep 19, 2013 @ 11:52
    Alex Skrypnyk
    0

    Hi Bart,

    Is your sitemap similar to the google example ? https://sites.google.com/site/qianballgreece/system/feeds/sitemap

    Make sure that your Sitemap is in an acceptable format (for more details, see Creating a Sitemap). Then upload your Sitemap to your server, and resubmit it.

    Thanks, Alex

  • Alex Skrypnyk 6163 posts 24143 karma points MVP 8x admin c-trib
    Sep 19, 2013 @ 11:52
    Alex Skrypnyk
    0

    Even though Google is telling this webmaster that the Sitemap file is bad, Google is actually eating (indexing) the contents of the file with no problem.

  • Comment author was deleted

    Sep 19, 2013 @ 12:05

    Hi Alex,

    I used the standard xslt template so I don't know. I change the output to xml and the code I use is

    <?xml version="1.0" encoding="UTF-8"?>
    <!DOCTYPE xsl:stylesheet [ <!ENTITY nbsp "&#x00A0;"> ]>
    <xsl:stylesheet 
      version="1.0" 
    
      xmlns:xsl="http://www.w3.org/1999/XSL/Transform" 
        xmlns:msxml="urn:schemas-microsoft-com:xslt" 
        xmlns:umbraco.library="urn:umbraco.library" xmlns:Exslt.ExsltCommon="urn:Exslt.ExsltCommon" xmlns:Exslt.ExsltDatesAndTimes="urn:Exslt.ExsltDatesAndTimes" xmlns:Exslt.ExsltMath="urn:Exslt.ExsltMath" xmlns:Exslt.ExsltRegularExpressions="urn:Exslt.ExsltRegularExpressions" xmlns:Exslt.ExsltStrings="urn:Exslt.ExsltStrings" xmlns:Exslt.ExsltSets="urn:Exslt.ExsltSets" 
        exclude-result-prefixes="msxml umbraco.library Exslt.ExsltCommon Exslt.ExsltDatesAndTimes Exslt.ExsltMath Exslt.ExsltRegularExpressions Exslt.ExsltStrings Exslt.ExsltSets "
    
    
    
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    
    
    >
    
    <xsl:output method="xml" omit-xml-declaration="yes"/>
    
    <xsl:param name="currentPage"/>
    
    <!-- update this variable on how deep your site map should be -->
    <xsl:variable name="maxLevelForSitemap" select="4"/>
    
    <xsl:template match="/">
    <div id="sitemap"> 
    <xsl:call-template name="drawNodes">  
    <xsl:with-param name="parent" select="$currentPage/ancestor-or-self::* [@isDoc and @level=1]"/>  
    </xsl:call-template>
    </div>
    </xsl:template>
    
    <xsl:template name="drawNodes">
    <xsl:param name="parent"/> 
    <xsl:if test="umbraco.library:IsProtected($parent/@id, $parent/@path) = 0 or (umbraco.library:IsProtected($parent/@id, $parent/@path) = 1 and umbraco.library:IsLoggedOn() = 1)">
    <ul id="sitemap"><xsl:for-each select="$parent/* [@isDoc and string(umbracoNaviHide) != '1' and @level &lt;= $maxLevelForSitemap]"> 
    <li>  
    <a href="{umbraco.library:NiceUrl(@id)}">
    <xsl:value-of select="@nodeName"/></a>  
    <xsl:if test="count(./* [@isDoc and string(umbracoNaviHide) != '1' and @level &lt;= $maxLevelForSitemap]) &gt; 0">   
    <xsl:call-template name="drawNodes">    
    <xsl:with-param name="parent" select="."/>    
    </xsl:call-template>  
    </xsl:if> 
    </li>
    </xsl:for-each>
    </ul>
    </xsl:if>
    </xsl:template>
    </xsl:stylesheet>
    
  • Alex Skrypnyk 6163 posts 24143 karma points MVP 8x admin c-trib
    Sep 19, 2013 @ 12:17
    Alex Skrypnyk
    0

    Bart, as I see in your code it's not XML ))

  • Alex Skrypnyk 6163 posts 24143 karma points MVP 8x admin c-trib
    Sep 19, 2013 @ 12:19
    Alex Skrypnyk
    0

    <urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
        <xsl:for-each select="$currentPage/ancestor-or-self::root/*[@nodeType = '1079']">
            <xsl:call-template name="drawItem" />
        </xsl:for-each>
    </urlset>
    

  • Alex Skrypnyk 6163 posts 24143 karma points MVP 8x admin c-trib
    Sep 19, 2013 @ 12:20
    Alex Skrypnyk
    0

    You need something like that

  • Dennis Aaen 4500 posts 18255 karma points admin hq c-trib
    Sep 19, 2013 @ 14:02
    Dennis Aaen
    0

    Hi Bart,

    I think something like could help you.

    <?xml version="1.0" encoding="UTF-8"?>
    <!DOCTYPE xsl:stylesheet [
      <!ENTITY nbsp "&#x00A0;">
    ]>
    <xsl:stylesheet
      version="1.0"
      xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
        xmlns:msxml="urn:schemas-microsoft-com:xslt"
        xmlns:umbraco.library="urn:umbraco.library" xmlns:Exslt.ExsltCommon="urn:Exslt.ExsltCommon" xmlns:Exslt.ExsltDatesAndTimes="urn:Exslt.ExsltDatesAndTimes" xmlns:Exslt.ExsltMath="urn:Exslt.ExsltMath" xmlns:Exslt.ExsltRegularExpressions="urn:Exslt.ExsltRegularExpressions" xmlns:Exslt.ExsltStrings="urn:Exslt.ExsltStrings" xmlns:Exslt.ExsltSets="urn:Exslt.ExsltSets" xmlns:pdcalendar="urn:pdcalendar" xmlns:google.maps="urn:google.maps"
        exclude-result-prefixes="msxml umbraco.library Exslt.ExsltCommon Exslt.ExsltDatesAndTimes Exslt.ExsltMath Exslt.ExsltRegularExpressions Exslt.ExsltStrings Exslt.ExsltSets pdcalendar google.maps ">

      <xsl:output method="html" />

      <xsl:param name="currentPage"/>
           
      <xsl:variable name="url" select="concat('http://',umbraco.library:RequestServerVariables('HTTP_HOST'))" />

      <!-- update this variable on how deep your site map should be -->
      <xsl:variable name="maxLevelForSitemap" select="4"/>

      <xsl:template match="/">
        <div id="sitemap">
          <xsl:call-template name="drawNodes">
            <xsl:with-param name="parent" select="$currentPage/ancestor-or-self::* [@isDoc and @level=1]"/>
          </xsl:call-template>
        </div>
      </xsl:template>

      <xsl:template name="drawNodes">
        <xsl:param name="parent"/>


        <xsl:if test="umbraco.library:IsProtected($parent/@id, $parent/@path) = 0 or
                    (umbraco.library:IsProtected($parent/@id, $parent/@path) = 1 and
                    umbraco.library:IsLoggedOn() = 1)">

          <xsl:for-each select="$parent/* [@isDoc and string(umbracoNaviHide) != '1' and @level &lt;= $maxLevelForSitemap]">
            <url xmlns="http://www.google.com/schemas/sitemap/0.84">
              <loc>

                <xsl:value-of select="$url"/>
                <xsl:value-of select="umbraco.library:NiceUrl(@id)"/>
              </loc>
              <lastmod>
                <xsl:value-of select="@updateDate" />+00:00
              </lastmod>

              <!-- optional: changefreq | values: always, hourly, daily, weekly, monthly, yearly, never -->
              <changefreq>
                weekly
              </changefreq>

              <priority>

                0.5
              </priority>
            </url>
            <xsl:if test="count(./* [@isDoc and string(umbracoNaviHide) != '1' and @level &lt;= $maxLevelForSitemap]) &gt; 0">
              <xsl:call-template name="drawNodes">
                <xsl:with-param name="parent" select="."/>
              </xsl:call-template>
            </xsl:if>
          </xsl:for-each>
        </xsl:if>
      </xsl:template>
    </xsl:stylesheet>

    /Dennis

  • Comment author was deleted

    Sep 19, 2013 @ 22:56

    Hi Dennis, 

    I put your code in a xslt which I loaded in a page trough a macro but i still get html as output.

    Any suggestions?

    thnx

    Bart

  • Dennis Aaen 4500 posts 18255 karma points admin hq c-trib
    Sep 19, 2013 @ 23:00
    Dennis Aaen
    0

    Hi Bart,

    Maybe you could try to change:

    method="html"/>

    To:

    method="xml" omit-xml-declaration="yes"/>

    And see if it does any difference

    /Dennis

  • Comment author was deleted

    Sep 20, 2013 @ 13:51

    Hi Dennis,

    Still no succes! The output is rendered as html an not as xml when I open the page in chrome.

    My code in a template how I use the macro

    <%@ Master Language="C#" MasterPageFile="~/umbraco/masterpages/default.master" AutoEventWireup="true" %>
    
    <asp:Content ContentPlaceHolderID="ContentPlaceHolderDefault" runat="server">
    
    
        <umbraco:Macro Alias="XMLSitemap" runat="server"></umbraco:Macro>
    
    
    </asp:Content>
    
Please Sign in or register to post replies

Write your reply to:

Draft