Dashboards & Visualizations

Simple XML - Encountering the error - EntityRef: expecting ';'

ben_leung
Builder

I have the below in my defaul.xml

<nav search_view="search" color="#2B60DE">
  <view name="private_searches" default='true' />
  <view name="private_dashboards" />
  <a href="/manager/search/saved/searches/_new?action=edit&ns=search">Create a saved search</a>
  <a href="/manager/search/data/ui/views/_new?action=edit&ns=search">Create a dashboard</a>
</nav>

When trying to save the page, I am getting the red banner

Encountered the following error while trying to update: In handler 'nav': Error parsing XML on line 5: EntityRef: expecting ';'

I am not sure, but I think it has to be escaped somehow. Does anyone know what should be done in this situation? I want to have a button on the navigation bar for redirecting directly to the create saved search and dashboard endpoint.

0 Karma
1 Solution

martin_mueller
SplunkTrust
SplunkTrust

Replace & with &amp;, the XML entity for an ampersand.

View solution in original post

martin_mueller
SplunkTrust
SplunkTrust

That 5. is just the new answers platform labelling every fifth line of code.

0 Karma

martin_mueller
SplunkTrust
SplunkTrust

Replace & with &amp;, the XML entity for an ampersand.

jrodman
Splunk Employee
Splunk Employee

Sure looks like it thinks the & is the start of an entity, but it's part of a quoted attribute value. Not sure where to go from here other than trying it and debugging it.

ben_leung
Builder
<nav search_view="search" color="#2B60DE">
  <view name="private_searches" default='true' />
  <view name="private_dashboards" />
  <a href="/manager/search/saved/searches/_new?action=edit&ns=search">Create a saved search</a>
  <a href="/manager/search/data/ui/views/_new?action=edit&ns=search">Create a dashboard</a>
</nav>

Weird how I see a "5." displayed in the code section above. Is there a bug in the new answers page?

0 Karma
Get Updates on the Splunk Community!

Adoption of RUM and APM at Splunk

    Unleash the power of Splunk Observability   Watch Now In this can't miss Tech Talk! The Splunk Growth ...

Routing logs with Splunk OTel Collector for Kubernetes

The Splunk Distribution of the OpenTelemetry (OTel) Collector is a product that provides a way to ingest ...

Welcome to the Splunk Community!

(view in My Videos) We're so glad you're here! The Splunk Community is place to connect, learn, give back, and ...