-
- Downloads
[ADD] QWeb: xml namespaces support in static template
With this patch, QWeb is able to support xml namespace declaration and prefixes. As this patch only deals with static template, the only method we have to patch is `_compile_static_node`. We make it able to serialize etree node having an nsmap by formating them to restore the xml prefix if present or to declare the xmlns attribute if needed. To know if the namespace definition is needed, we compare the tuples of (xmlprefix, xmldefinition) of the node and its parent. The namespace definition of the parent is passed by a dict in the `options` key. We took care of dealing with the mutable + recursion thing by working with copy of this namespace definition dict. Two tests have been introduced, basically what we pass to QWeb is what it has to return.
Please register or sign in to comment