I am using Diazo with Plone and have some xsl code that is working in the root of rules.xml but not inside an included .xml file. I would like to keep my rules.xml simple and keep the section specific styling inside each section's .xml file.
How can I add the class "subNav" to all li's using diazo from section-one.xml?
Not working (but desired):
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:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:xi="http://www.w3.org/2001/XInclude">
<rules if-path="section-one/">
<xi:include href="section-one.xml" />
<theme href="templates/section-one.html" />
</rules>
<rules if-not-path="section-two/">
<xi:include href="section-two.xml" />
<theme href="templates/section-two.html" />
</rules>
</rules>
section-one.xml
<?xml version="1.0" encoding="UTF-8"?>
<rules
xmlns="http://namespaces.plone.org/diazo"
xmlns:css="http://namespaces.plone.org/diazo/css"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:xi="http://www.w3.org/2001/XInclude">
<replace css:content="#content" css:theme="#content"/>
<xsl:template match="//li">
<xsl:copy>
<xsl:attribute name="class">subNav</xsl:attribute>
<xsl:apply-templates />
</xsl:copy>
</xsl:template>
</rules>
Working (but not desired):
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:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:xi="http://www.w3.org/2001/XInclude">
<rules if-path="section-one/">
<xi:include href="section-one.xml" />
<theme href="templates/section-one.html" />
</rules>
<rules if-not-path="section-two/">
<xi:include href="section-two.xml" />
<theme href="templates/section-two.html" />
</rules>
<xsl:template match="//body[contains(@class, 'section-one')]//li">
<xsl:copy>
<xsl:attribute name="class">subNav</xsl:attribute>
<xsl:apply-templates />
</xsl:copy>
</xsl:template>
</rules>
section-one.xml
<?xml version="1.0" encoding="UTF-8"?>
<rules
xmlns="http://namespaces.plone.org/diazo"
xmlns:css="http://namespaces.plone.org/diazo/css"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:xi="http://www.w3.org/2001/XInclude">
<replace css:content="#content" css:theme="#content"/>
</rules>