Skip to main content
Level 3
May 25, 2026
Question

colon issue in HTML

  • May 25, 2026
  • 1 reply
  • 5 views

We are using the trackingfeature attribute in HTML file  like this:

<coral-card trackingfeature="aem:tracking:test">

In older AEM versions this works fine, but in AEM 6.5.2 LTS, the value is not getting set when it contains a colon (:). If we remove the colon (for example aem-tracking-test), it works correctly.

Why is the colon value not working in AEM 6.5.2 LTS, and what is the correct way to use values like aem:tracking:test while keeping the colon?

1 reply

Level 4
May 25, 2026

Hi ​@user96222,

 

The colon issue in AEM 6.5.2 LTS is related to how the HTL/Sightly parser and HTML attribute value handling changed in stricter LTS builds, colons in attribute values can be interpreted as namespace separators in certain contexts.


Here are your options:

 

Option 1: Encode the colon in HTL
Instead of passing the raw value, encode it using HTL string manipulation:

trackingfeature="aem:tracking:test"

Pass it as a data attribute and encode in HTL: data-trackingfeature="${'aem:tracking:test'}"


Option 2: Use a Sling Model or Use-class
Store the tracking value in your component's Sling Model and expose it as a clean string property, then reference it in HTL:

trackingfeature="${model.trackingFeature}"

This avoids the parser interpreting the colon directly in the template.

 

Option 3: HTML encode the colon
Use the Unicode or HTML entity representation:
aem&#58;tracking&#58;test

 

This renders as aem:tracking:test in the browser but bypasses the parser issue.

 

Root cause: AEM 6.5.2 LTS tightened XML/HTML namespace handling in the HTL parser. Values containing colons in attribute positions can be misread as namespace-prefixed attributes (similar to XML namespaces like xlink:href).

 

Which approach are you using to set this attribute, directly in HTL template, via JS, or via a backend model? That will help confirm the exact fix.