I want to generate the following entry in .xml file with Thymeleaf
<postalCode xsi:type="extPL:adxp.postalCode"> </postalCode>
to do so, I have the following template:
<postalCode th:attr="xsi:type='extPL:adxp.postalCode' </postalCode>
but the phrase xsi:type
contains colon which breaks the syntax of the expression. How can I escape the colon to make it work?
I tried various approaches with substituting :
for colon or "
for '
, but nothing worked for me.
You could use single quotes '
to mask the colon like so
<postalCode th:attr="'xsi:type'='extPL:adxp.postalCode' </postalCode>
or the whole attribute argument
<postalCode th:attr="'xsi:type=extPL:adxp.postalCode'" </postalCode>