This question has been flagged

In Odoo, XML are processed with lxml.etree library. This lib support XSLT by default. So I guess it is possible to use it in views with inherited templates (like in website). For example, XSLT make it easy to select all h4 tags, with attributes and surrounded content.

I've made some tests with Odoo 10. But I allways got nonsense errors with the first xsl element, like this one :

"Element '<{namespace}template match="//h4">' cannot be located in parent  view"

If I first add  xsl:stylesheet tag with namespace, the error is reported on the element

'<{namespace}stylesheet version="1.0">'

These errors comes from /addons/base/ir/ir_ui_view.py, lines 525-603,  apply_inheritance_specs function.

I'm not a Python developer, and I don't understand how to get the lxml.etree error log instead of this error message (see https://lxml.de/api.html#error-logging).

Can someone help me ?
Any idea to succeed with XSLT in views templates ?

Avatar
Discard