Thursday, December 06, 2012

Data at the root level is invalid. Line 1, position 1

Recently I exported a publishing sub-site from SharePoint 2010 and imported it as a site collection. After the import, the pages were displaying properly, but when I tried to add a new page, I got an error "Data at the root level is invalid. Line 1, position 1". I was also not able to edit the pages or access the "Page layouts and site templates" link from the site settings, both operations were failing.

Search on the web led me to http://blog.falchionconsulting.com/index.php/2007/09/convert-a-sub-site-to-a-site-collection/. As stated in the blog, I set the __PageLayouts property of the site collection to blank instead of "__inherit". Doing so allowed me to edit the page, but still was not able to create a new page or access the "Page layouts and site templates" page.

Next, I compared the property values of the site with the issue to a site collection that was working properly. I found property value of __DefaultPageLayout set to "__inhert", so I changed that to blank, still no luck. I continued the comparison process and found a property "__InheritCurrentNavigation" set to "True". This property was not present in the site collection that was working properly, so I deleted this property from the site collection, after doing so, I was able to add a new page and access the "Page layouts and site template" page.

I found few more properties (__IneritsAlternateCssUrl, __InheritsThemedCssFolderUrl, __InheritWebTemplates) that were present in the site collection with the problem, but were not present in the site collection that was working properly. To be safe I removed them as well.

Here is a summary of changes to the properties of the site collection:

__PageLayouts - set to blank
__DefaultPageLayout - set to blank
__InheritCurrentNavigation - delete
__IneritsAlternateCssUrl - delete
__InheritsThemedCssFolderUrl - delete
__InheritWebTemplates - delete