plone / diazo

Diazo applies a static HTML theme to a dynamic website
http://diazo.org
Other
41 stars 26 forks source link

Diazo strips xmlns elements #48

Open loechel opened 9 years ago

loechel commented 9 years ago

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

lrowe commented 9 years ago

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.