Copied to clipboard

Flag this post as spam?

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


  • Alan Feekery 5 posts 25 karma points
    Nov 16, 2011 @ 18:09
    Alan Feekery
    0

    Extra content at the end of the document

    The sitemap keeps returning blank with just: 

    <urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.sitemaps.org/schemas/sitemap/0.9 http://www.sitemaps.org/schemas/sitemap/0.9/sitemap.xsd"></urlset>

    I have tried the XSLT one & the razor one.

    When I add in "?umbDebugShowTrace=true" to my sitemap url I get this error for the XSLT one:

    error on line 7 at column 1: Extra content at the end of the document

    And this for the Razor one:

    error on line 11 at column 1: Extra content at the end of the document

    I'm running umbraco v 4.7.0, .net 4.0, windows server 2008 with IIS 7. This has happened to me locally though too so I don't think it's to do with the server.

    Any help will be much appreciated, I'm close to just hardcoding in the site map at this stage. =(


     

     

     

  • Leonidas Dedousis 9 posts 29 karma points
    Mar 10, 2013 @ 12:37
    Leonidas Dedousis
    0

    Heving the same issue.. any progress on this?

  • Emma Garland 41 posts 123 karma points MVP 7x c-trib
    Jul 28, 2014 @ 03:35
    Emma Garland
    1

    This post is a year old but I have just sorted this after several hours of no avail and I'm so happy I thought I'd post! Hopefully it will help someone, even if you implement the fix slightly differently.

    In order to get around this issue I first looked in the Umbraco log file at "App_Data\Logs\UmbracoTraceLog.txt"

    It turned out my error was "Error loading MacroEngine script (file: CultivSearchEngineSitemap.cshtml, Type: ''. Exception: Microsoft.CSharp.RuntimeBinder.RuntimeBinderException: Cannot perform runtime binding on a null reference".

    I debugged the Razor file from Visual Studio to see what was going on and startNode was null, causing the error. This is because my Sitemap was trying to call Model.AncestorOrSelf(1) and as it was outside the root website (I'd created it at the top level), there was no ancestor present at all.

    In order to correct this I moved my content node of type Sitemap underneath the Home website root to enable it to traverse. There were several options of how to do this instead (create a root node parameter, traverse siblings, call the Home docType etc), all of which have been discussed, but it's 2am and I've gone for the moving Sitemap child node for now!

    Secondly (and this is the key to the fix I think), in the Linq statement:

     foreach (var node in startNode.Children
            .Where("HasAccess")
            .Where("!IsProtected")
            .Where("umbracoNaviHide == false")
          )
    

    This needed to be replaced with our implementation of umbracoNaviHide, which had been renamed with hideInNavigation. This caused it to bomb out as it didn't have that property:

    .Where("hideInNavigation == false")
    

    This may not solve it for everyone but stepping through in a similar fashion at least may help with any issues you are having.

Please Sign in or register to post replies

Write your reply to:

Draft