th:attr lowercases attribute names in XML mode - workaround? #897
-
Spring MVC 5.3 app using org.thymeleaf.spring5.SpringTemplateEngine 3.0.12.RELEASE with the nz.net.ultraq.thymeleaf.layoutdialect.LayoutDialect 3.0.0 What are the differences between XML and HTML mode when doing variable insertion? I can't find anything in the docs and couldn't find the answer after half-an-hour of looking at the source code. See the issue I created for this for an explanation of what I want to do and the behavior #896
The resulting output is
Note that entityID becomes entityid and validUntil becomes validuntil. I've never seen this behavior before. Does XML mode not support th:attr?. If so where can I find this to lower case in the source code or docs? Also asked this on https://stackoverflow.com/questions/72958514/how-to-use-thattr-in-thymeleaf-xml-mode |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
Why is the xml lowercased?The real answer to this is: it isn't. When viewed from a web browser DOM this is the case because the content type was set incorrectly to text/html, but a curl request on the endpoint exposing this xml file confirmed that the attribute names are properly cased. For others benefit, see caseSensitive attribute in TemplateMode.java for case insensitivity set true on HTML template mode, but false on all others (including XML). |
Beta Was this translation helpful? Give feedback.
Why is the xml lowercased?
The real answer to this is: it isn't. When viewed from a web browser DOM this is the case because the content type was set incorrectly to text/html, but a curl request on the endpoint exposing this xml file confirmed that the attribute names are properly cased.
For others benefit, see caseSensitive attribute in TemplateMode.java for case insensitivity set true on HTML template mode, but false on all others (including XML).