SharePoint Online Page Layout Pages with Summary Links - Error while executing the web part

SharePoint Online Page Layout Pages with Summary Links - Error while executing the web part

[Srinivas Varukala](https://social.msdn.microsoft.com/profile/Srinivas Varukala) 5/17/2016 7:57:19 PM


You have a page that is based on page layouts that contains summary link web parts or the field control. And when you edit the page properties, you will see an error for the summary links web part or the field control section something like below: “Error while executing the web part” along with a correlation ID. In the ULS logs you will see entries like below:

> _Application error when access /teams/pagenameaspx, Error=Root element is missing._ _at System.Xml.XmlTextReaderImpl.ThrowWithoutLineInfo(String res)_ _at System.Xml.XmlTextReaderImpl.ParseDocumentContent()_ _at System.Xml.XmlLoader.Load(XmlDocument doc, XmlReader reader, Boolean preserveWhitespace)_ _at System.Xml.XmlDocument.Load(XmlReader reader)_ _at Microsoft.SharePoint.Publishing.WebControls.CmsDataFormWebPart.GetXslFile(String templateFileUrl)_ _at Microsoft.SharePoint.Publishing.WebControls.CmsDataFormWebPart.PopulateDropDown(DropDownList ddl, String selectedValue, String xslUrl, String resourcePrefix)_ _at Microsoft.SharePoint.Publishing.WebControls.SummaryLinkWebPart.discoverImportedTemplates()_ _at Microsoft.SharePoint.Publishing.WebControls.SummaryLinkWebPart.OnLoad(EventArgs e)_ _at System.Web.UI.Control.LoadRecursive()_ _at System.Web.UI.Control.AddedControl(Control control, Int32 index)_ _at Microsoft.SharePoint.WebPartPages.WebPart.AddParsedSubObject(Object obj)_ _at Microsoft.SharePoint.WebPartPages.DataFormWebPart.CreateChildControls()_ _at System.Web.UI.Control.EnsureChildControls()_ _at System.Web.UI.Control.PreRenderRecursiveInternal()_ _at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)_
> 
>  _Error while delta-compile custom Xsl for dataformwebpart: System.Xml.Xsl.XslLoadException: XSLT compile error. An error occurred_ _at https://tenantname.sharepoint.com/teams/stylesheet.xsl(0,0). ---> System.Xml.XmlException: Root element is missing._ _at System.Xml.XmlTextReaderImpl.ThrowWithoutLineInfo(String res)_ _at System.Xml.XmlTextReaderImpl.ParseDocumentContent()_ _at System.Xml.Xsl.Xslt.XsltInput.ReadNextSibling()_ _at System.Xml.Xsl.Xslt.XsltInput.FindStylesheetElement()_ _at System.Xml.Xsl.Xslt.XsltLoader.LoadDocument()_ _ at System.Xml.Xsl.Xslt.XsltLoader.LoadStylesheet(XmlReader reader, Boolean include)     -_ _-- End of inner exception stack trace ---_ _at System.Xml.Xsl.Xslt.XsltLoader.LoadStylesheet(XmlReader reader, Boolean include)_ _at System.Xml.Xsl.Xslt.XsltLoader.LoadStylesheet(Uri uri, Boolean include)_ _at System.Xml.Xsl.Xslt.XsltLoader.LoadStylesheet(XmlReader reader, Boolean include)_ _at System.Xml.Xsl.Xslt.XsltLoader.Load(Compiler compiler, Object stylesheet, XmlResolver xmlResolver)_ _at System.Xml.Xsl.XslCompiledTransform.CompileToType(XmlReader stylesheet, XsltSettings settings, XmlResolver stylesheetResolver, Boolean debug, TypeBuilder typeBuilder, String scriptAssemblyPath)_ _at Microsoft.Xslt.STransform.CompileToType(XmlReader reader, XsltSettings xsltSettings, XmlResolver xmlResolver)_ _at Microsoft.SharePoint.WebPartPages.DataFormWebPart.CustomizedXslWorker(STransform baseXslt, String webUrl, String Xsl, String baseViewID, String templateType, String viewStyleID)_ _ at Microsoft.SharePoint.WebPartPages.DomainRunner.Invoke()_ _Getting Error Message for Exception System.Web.HttpUnhandledException (0x80004005): Exception of type 'System.Web.HttpUnhandledException' was thrown. ---> System.Xml.XmlException: Root element is missing._ _at System.Xml.XmlTextReaderImpl.ThrowWithoutLineInfo(String res)_ _at System.Xml.XmlTextReaderImpl.ParseDocumentContent()_ _at System.Xml.XmlLoader.Load(XmlDocument doc, XmlReader reader, Boolean preserveWhitespace)_ _at System.Xml.XmlDocument.Load(XmlReader reader)_ _at Microsoft.SharePoint.Publishing.WebControls.CmsDataFormWebPart.GetXslFile(String templateFileUrl)_ _at Microsoft.SharePoint.Publishing.WebControls.CmsDataFormWebPart.PopulateDropDown(DropDownList ddl, String selectedValue, String xslUrl, String resourcePrefix)_ _at Microsoft.SharePoint.Publishing.WebControls.SummaryLinkWebPart.discoverImportedTemplates()_ _at Microsoft.SharePoint.Publishing.WebControls.SummaryLinkWebPart.OnLoad(EventArgs e)_ _at System.Web.UI.Control.LoadRecursive()_ _at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)_ _at System.Web.UI.Page.HandleError(Exception e)_ _at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)_ _at System.Web.UI.Page.ProcessRequest(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)_ _at System.Web.UI.Page.ProcessRequest()_ _at System.Web.UI.Page.ProcessRequest(HttpContext context)_ _at System.Web.HttpApplication.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute()_ _ at System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously)_

This usually happens if you have used third party tools to migrate your onpremises SharePoint content to SharePoint Online. The summary links web part leverages XSLT to display the links on the page. This XSLT is stored in “Style Library” document library under “XSL Style Sheets” folder. Check that these XSLT files are not empty. You can download these files to your machine and verify if its zero bytes or empty. Resolution: Pick another site that has working pages and page layouts and copy the XSLT files from there and overwrite the empty XSLT files in the problematic site. This should fix the issue. HTH

About the author

I work with customers helping them achieve more using Microsoft Technologies. I am in my 9th year with Microsoft as of March 2020. I get to work with really smart people (both at Microsoft and Customers). Helping customers, removing any blockers, rapid prototyping is my core work.