Thymeleaf 3: xmlns not removed for custom dialect

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Thymeleaf 3: xmlns not removed for custom dialect

xtian
Since I upgraded to Thymeleaf 3.0.2 all rendered pages show the xmlns of my custom dialect in the <html> tag.

Example:

<html xmlns="http://www.w3.org/1999/xhtml" lang="it" xmlns:mydialect="http://www.mydialect.ex">

They are correctly removed for the "standard" dialects (th, sec, layout).
What am I missing?
I updated my dialect from Thymeleaf 2 following the tutorial.

Thank you.
Reply | Threaded
Open this post in threaded view
|

Re: Thymeleaf 3: xmlns not removed for custom dialect

danielfernandez
Administrator
Hello,

You actually found something missing in the "Extending Thymeleaf" tutorial and its example application. We've just fixed it.

Removing any additional attributes added for IDE validation like xmlns:mydialect is now the responsibility of the dialect, which should add a processor for it if needed. Or simply use StandardXmlNsTagProcessor like seen here: https://github.com/thymeleaf/thymeleafexamples-extrathyme/blob/ece95292a7eaa99acb2aa80b6948448a24c3f4d9/src/main/java/thymeleafexamples/extrathyme/dialects/score/ScoreDialect.java#L53-L54

2.1's engine automatically removed all xmlns:* attributes, but this was too intrusive, and could actually end up removing attributes that were needed. So 3.0 left it in the hands of each dialect.

Thanks,
Daniel.