[
https://issues.apache.org/jira/browse/SLING-10177?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17334792#comment-17334792
]
Radu Cotescu commented on SLING-10177:
--------------------------------------
In the HTML 5 specification, specifically in the HTML syntax chapter dedicated
to attributes [0], there's this paragraph:
{quote}There must never be two or more attributes on the same start tag whose
names are an ASCII case-insensitive match for each other.
{quote}
[0] - [https://html.spec.whatwg.org/multipage/syntax.html#attributes-2]
> Multiple data-sly-attribute blocks on one HTL tag don't work correctty
> ----------------------------------------------------------------------
>
> Key: SLING-10177
> URL: https://issues.apache.org/jira/browse/SLING-10177
> Project: Sling
> Issue Type: Bug
> Components: Scripting
> Reporter: Radu Cotescu
> Assignee: Radu Cotescu
> Priority: Major
>
> From [https://github.com/adobe/htl-spec/issues/92:]
> When multiple {{data-sly-attribute="$\{model.map\}"}} are used on a single
> HTL element, only the last one is evaluated.
> Given that the {{model}} and {{model2}} have a method {{map}} that returns a
> String -> String map, the following HTL code will not render attributes
> defined in {{model2.map}}
> {code:html}
> // model1.map -> \{'a' : 'val a'}
> // model2.map -> \{'b': 'val b' }
> <div
> data-sly-use.model1="com.Model1"
> data-sly-use.model2="com.Model2"
> data-sly-attribute="${model1.map}"
> data-sly-attribute="${model2.map}">
> </div>
> {code}
> h3. Expected Behaviour
> Expected HTML output
> {code:html}
> <div a="val a" b="val b"></div>
> {code}
> h3. Actual Behaviour
> Actual HTL output
> {code:html}
> <div b="val b"></div>
> {code}
--
This message was sent by Atlassian Jira
(v8.3.4#803005)