How to add multiple formats for <li> element in <ul>


Derek Fess
 

I'm running DITA-OT 3.2.1

Our company has rebranded, and as such we now have a new Marketing style guide. I need to format three levels of bullets. This part I've done (using the commonvariables.xml file). However, I need to make them different colors depending on which level they are at. All that I can seem to do is set the color for all levels, using the ul.li__label attribute set. If I understand correctly, I can make a new attribute set (say ul.li.li__label), but would have to call it from the lists.xsl file. This is where I am stuck. I do not know xslt well enough to know how to construct what I need. I know I need to use this piece of code from the pdf2 lists.xsl file:

<xsl:template match="*[contains(@class, ' topic/ul ')]/*[contains(@class, ' topic/li ')]">
        <xsl:variable name="depth" select="count(ancestor::*[contains(@class, ' topic/ul ')])"/>
        <fo:list-item xsl:use-attribute-sets="ul.li">
            <xsl:call-template name="commonattributes"/>
            <fo:list-item-label xsl:use-attribute-sets="ul.li__label">
                <fo:block xsl:use-attribute-sets="ul.li__label__content">
                    <xsl:call-template name="getVariable">
                        <xsl:with-param name="id" select="concat('Unordered List bullet ', (($depth - 1) mod 4) + 1)"/>
                    </xsl:call-template>
                </fo:block>
            </fo:list-item-label>
            <fo:list-item-body xsl:use-attribute-sets="ul.li__body">
                <fo:block xsl:use-attribute-sets="ul.li__content">
                    <xsl:apply-templates/>
                </fo:block>
            </fo:list-item-body>
        </fo:list-item>
    </xsl:template>

Any help would be greatly appreciated.

Join main@dita-users.groups.io to automatically receive all group messages.