Pa.theming (diazo) outputs prefixed nodes

Hi,
I am refactoring our theme since a few days - split up files, and simplify them - but today I saw an weird HTML output in themed view:

    <diazo:rules xmlns:diazo="http://namespaces.plone.org/diazo" xml:id="r60">

This is the part in rules.xml

<xsl:if test="/html/body[contains(concat(' ', normalize-space(@class), ' '),' portaltype-project ')]">
    <xsl:if test="/html/body[contains(concat(' ', normalize-space(@class), ' '),' template-project ')]">
        <xi:include href="./includes/project-detail.xml"/>
    </xsl:if>
</xsl:if>

By the way, i also tried it with

<rules css:if-content="body.portaltype-project">
    <xi:include href="./includes/project-detail.xml"/>
    <append css:theme="body">10</append>
</rules>

And on other Outputs:
<diazo:header> instead of <header>

Or this in themed output:

```3````

But the same result!
How can I prevent Diazo/pa.theming print it

Hi, which versions of Plone and Diazo are you running? I haven't seen that behavior before.

Can you reproduce that with a simple diazo theme, like when you create a new one TTW?

Thomas

Hi,
it seems to be an theme related "bug" - I can't reproduce it with default "Twitter Bootstap Example"!

Maybe its, because I merge Diazo- and XSLT Rules ?!

I uploaded my (simplified) rules
rules.xml - https://pastebin.com/UgZaFzJL (include line nr:95)
inclucluded file - https://pastebin.com/2GpMxuYs

Used Versions:
Plone 4.3.4.1
pa.theming 1.1.3
diazo 1.0.6

I couldn't find any weird things right now. I would start debugging this by removing all the rules and then including them one by one again until you get that output. I would also recommend to rewrite some of your rules into smaller parts and not using xslt all the time, e.g. the big replace block in line 65-102 which also contains a lot of xi:include.

I would also remove the line

<xsl:output encoding="UTF-8" indent="no" method="html" version="5.0" />

which can have some side-effects. Better set the doctype in your manifest.cfg:

doctype = <!DOCTYPE html>

and the correct meta tags in your index.html:

<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />

Ok, this is my simplest test - it does not work

rules.xml

<?xml version="1.0" encoding="UTF-8"?>
<rules xmlns="http://namespaces.plone.org/diazo"
    xmlns:css="http://namespaces.plone.org/diazo/css"
    xmlns:xi="http://www.w3.org/2001/XInclude"
    xmlns:xsl="http://www.w3.org/1999/XSL/Transform">

    <theme href="./static/theme.html"/>
    <replace css:theme-children="div#wrapper">
        <xi:include href="./includes/collection.xml" />
    </replace>
</rules>

included file.xml

<?xml version="1.0" encoding="UTF-8"?>
<rules xmlns="http://namespaces.plone.org/diazo"
       xmlns:css="http://namespaces.plone.org/diazo/css"
       xmlns:xi="http://www.w3.org/2001/XInclude"
       xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
  <xsl:value-of select="$base"/>
</rules>

Output

<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml" class="no-js">

<head>
<base href="http://127.0.0.1:8080/fhstp/de/" />
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
  <title>fhstp.theme</title>
</head>

<body><div id="wrapper">
        <rules xml:id="r3">
  http://127.0.0.1:8080
</rules>
    </div></body>

</html>

It seems, that I cannot include different (based on conditions) files/rules into an replaced content.....

Try to rewrite it (untested):

<?xml version="1.0" encoding="UTF-8"?>
<rules xmlns="http://namespaces.plone.org/diazo"
    xmlns:css="http://namespaces.plone.org/diazo/css"
    xmlns:xi="http://www.w3.org/2001/XInclude"
    xmlns:xsl="http://www.w3.org/1999/XSL/Transform">

    <theme href="./static/theme.html"/>
    <xi:include href="./includes/collection.xml" />
</rules>

included file.xml:

<?xml version="1.0" encoding="UTF-8"?>
<rules xmlns="http://namespaces.plone.org/diazo"
       xmlns:css="http://namespaces.plone.org/diazo/css"
       xmlns:xi="http://www.w3.org/2001/XInclude"
       xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
  <replace css:theme-children="div#wrapper">
    <xsl:value-of select="$base"/>
  </replace>
</rules>

Thank you, I already did it like you suggested (it works)...

But this approach means, I have to rewrite my static filey too.... :sweat: