Collective.xdv worked example
-----------------------------

The initial rulesfile was taken from the collective.xdv documentation.
To this, we added:

Multiple themes
~~~~~~~~~~~~~~~

We want to use a different theme for the "News" section. This is done using the
<theme> directive. 

We did this by setting a selector for the body element's content class::
    
    <theme href="theme.html" />
    <theme 
        href="theme-news.html" 
        css:if-content="body.section-news"
        />

Note that we have to set the fallback theme. Failing to do so will result in an
unthemed page.

To use a specific theme for a content type, you can use another selector for
the body element's class, ie::

    <theme href="theme.html" />
    <theme 
        href="theme-news.html" 
        css:if-content="body.portaltype-folder"
        />

You could also theme for a specific template in this way.

This only works on xdv >= 0.4b3, which the current KGS does
not include. To force the right version of xdv, add this to your buildout::

    [versions]
    xdv = 0.4b3

Including extra rules files
~~~~~~~~~~~~~~~~~~~~~~~~~~~

To include an extra rules file, use the XInclude statement. You could use this
statement to slit up a large rules file into separate files.

For example, this rule in `rules.xml` calls another rules file `rules-standard.xml`::

    <!-- Stuff that happens on all pages -->
    <xi:include href="rules-standard.xml" />

This one executes the `rules-document.xml`, but only for Plone Document
objects::

    <!-- Stuff that happens on Plone's Documents (standard pages) only -->
    <rules css:if-content="body.portaltype-document">
        <xi:include href="rules-document.xml" />
    </rules>


