diazo icon indicating copy to clipboard operation
diazo copied to clipboard

Diazo strips xmlns elements

Open loechel opened this issue 8 years ago • 1 comments

I have a Theme where I want to have ESI declared in the Theme, not via the Rules.

Diazo seams to strip the xmlns namespace tags on elements so that it did not work:

Theme:

<esi:remove >
    <div>...</div>
</esi:remove> 

got translated to:

<remove>
    <div>...</div>
</remove>

same on

<esi:include src="/path" / > --> <include src="/path" />

I guess this will also apply to other XMLNS additions of HTML

loechel avatar Oct 18 '15 09:10 loechel

This is unavoidable as all namespace prefixes are stripped by the libxml2 HTMLParser.

HTML has no concept of namespaces, though browsers do seem to allow ':' in element and attribute names which at least preserves them.

From the command line, Diazo does at least partially support using the XMLParser when compiling a theme. Perhaps a parser attribute could be added to the <theme> element to specify the parser on a per theme basis in rules.py expand_themes.

lrowe avatar Oct 22 '15 23:10 lrowe