I've been banging around with this one for a while now and I just can't seem to locate where to put my modification.
Product: XMetaL Author v5.5
Specifically, I'd like to add a new line with "or" between
<choice> items in a
<choices> list to match our company's style. Now, normally, I'd just use some CSS to do this but, sadly, it seems that HTML Help cannot make use of the
:after pseudo element. So it seems just as easy to modify the XSL transform to produce this for me. I know pretty much how to write the XML Stylesheet to do this:
<xsl:template match="*[contains(@class,' choice/choice ')]">
<li><xsl:value-of select="." />
<xsl:if test="position()!=last()">
<p>or,</p>
</xsl:if>
</li>
</xsl:for-each>
...but I cannot locate where in the DITA-OT files to place the extra style bit (and there's sure to be more to it, but until I even find where this transform takes place, I won't know).
I've located what appears to be the inclusion of the unordered list for the <choices> element in the
.../xsl/xslhtml/taskdisplay.xsl file, around line 619. The unordered list is in this template, anyway. However, the templates "commonattributes," "gen-style," and "setid" don't appear to have anything to do with the display of list items (but surely that's wrong as there's nothing else there!). Further, my searching through the DITA-OT files using FileLocator Lite has turned up nothing (e.g.,
choice-fmt turns up nothing).
Anyone have any thoughts? Any DITA-OT hackers out there who know how to track this sort of thing down? In the meantime, I'm using jQuery to do this, but that's a bit like swatting flies with missiles and I'd love to loose the JavaScript overhead if possible.
(Note: Yes, I've made backup copies of all of these files before I ever started tinkering.)
Update:
I solved this one myself after a spending a couple of hours away from it. It seems that I was looking in
exactly the right spot, just not identifying what I was seeing (I'll be cracking some books on XSL to be sure).
This is a cleaned up portion of what I modified in
taskdisplay.xsl:
<xsl:template match="*[contains(@class,' task/choices ')]" mode="choices-fmt">
...
<!-- large section of un-modified template goes here-->
...
<ul> <!-- The beginning of a <choices> list -->
<xsl:call-template name="commonattributes"/>
<xsl:call-template name="gen-style">
<xsl:with-param name="conflictexist" select="$conflictexist"></xsl:with-param>
<xsl:with-param name="flagrules" select="$flagrules"></xsl:with-param>
</xsl:call-template>
<!-- begin custom <choice> list items -->
<xsl:for-each select="choice">
<li>
<xsl:call-template name="setid"/>
<xsl:apply-templates/>
<xsl:if test="position()!=last()">
<span class="choicesSeparator">or</span>
</xsl:if>
</li>
</xsl:for-each>
<!-- end custom list -->
<!-- <xsl:call-template name="setid"/>
<xsl:apply-templates/> --> <!-- Rem out portions which need to be included in xsl:if loop above -->
</ul><xsl:value-of select="$newline"/>