Personalisation error in CM on ‘Hide’ condition

Mark Gibbons
2 min readJul 27, 2019

--

If you’re getting the following error in Experience Editor on personalised components, then read on for a solution.

Error Rendering Xslt: /xsl/system/webedit/hidden rendering.xslt: The ‘ ‘ character, hexadecimal value 0x20, cannot be included in a name.

This happens when the component’s Parameters Template has one or more fields that contain spaces or special characters in the field name. This has been documented since Sitecore 6.2 in the “4.13 How to Implement a Rendering Settings Data Template” section of “Presentation Component Cookbook”.

Since I have hit this issue in Sitecore 9, it is still very much relevant today.

The solution

Well, we need to remove spaces from all these fields. However they are all stored on the Renderings and Final Renderings fields on all the content items that use them, so this is an impossible task to do manually.

Time to break out SPE

This script will find all parameters templates in the master DB and then recursively rename the fields and all usages in all versions and all languages.

You then need to make sure any code that has the field names hard coded is changed too.

Full stack trace for searches

Error Rendering Xslt: /xsl/system/webedit/hidden rendering.xslt: The ‘ ‘ character, hexadecimal value 0x20, cannot be included in a name.
at System.Xml.XmlConvert.VerifyNCName(String name, ExceptionType exceptionType)
at System.Xml.XmlQualifiedName.Verify()
at System.Xml.Xsl.XsltArgumentList.AddParam(String name, String namespaceUri, Object parameter)
at Sitecore.Mvc.Presentation.XsltRenderer.AddParameters(XsltArgumentList arguments)
at Sitecore.Mvc.Presentation.XsltRenderer.GetArguments()
at Sitecore.Mvc.Presentation.XsltRenderer.Render(TextWriter writer)
at Sitecore.Mvc.Pipelines.Response.RenderRendering.ExecuteRenderer.Render(Renderer renderer, TextWriter writer, RenderRenderingArgs args)

--

--

Mark Gibbons
Mark Gibbons

Written by Mark Gibbons

Technical Architect @ Aceik | Sitecore Technology MVP 2020 - 2024 with a love for all things #Sitecore / Twitter twitter.com/markgibbons25

Responses (2)