c2d32021470555cd0dcf157634afaedbb34f62a5Rob Austein;; $Id: patch-db2latex-duplicate-template-bug,v 1.2 2007/01/12 22:24:20 sra Exp $
c2d32021470555cd0dcf157634afaedbb34f62a5Rob Austein;; This is a patch to work around a known bug in db2latex. Apparently
c2d32021470555cd0dcf157634afaedbb34f62a5Rob Austein;; xsltproc's error checking got a lot better since the authors of
c2d32021470555cd0dcf157634afaedbb34f62a5Rob Austein;; db2latex last tested this, so a clear language violation that
c2d32021470555cd0dcf157634afaedbb34f62a5Rob Austein;; xsltproc used to ignore now prevents xsltproc from working with
c2d32021470555cd0dcf157634afaedbb34f62a5Rob Austein;; On FreeBSD you can simply drop this patch into the directory
c2d32021470555cd0dcf157634afaedbb34f62a5Rob Austein;; /usr/ports/textproc/db2latex/files/ and the ports system should
c2d32021470555cd0dcf157634afaedbb34f62a5Rob Austein;; take it from there. I've sent this patch off to the port
c2d32021470555cd0dcf157634afaedbb34f62a5Rob Austein;; maintainer but have not yet heard anything back.
c2d32021470555cd0dcf157634afaedbb34f62a5Rob Austein;; I don't really know whther this is the "right" fix, but it seems to
c2d32021470555cd0dcf157634afaedbb34f62a5Rob Austein;; work, and I'm pretty sure that the code this patch deletes does not
c2d32021470555cd0dcf157634afaedbb34f62a5Rob Austein;; work as it stands, so at worst the result after applying this patch
c2d32021470555cd0dcf157634afaedbb34f62a5Rob Austein;; should be no worse than the result without this patch.
c2d32021470555cd0dcf157634afaedbb34f62a5Rob Austein;; YMMV. If this patch breaks, you get to keep both pieces.
c2d32021470555cd0dcf157634afaedbb34f62a5Rob Austein--- xsl/qandaset.mod.xsl.~1~ Sun Jan 4 08:22:27 2004
c2d32021470555cd0dcf157634afaedbb34f62a5Rob Austein+++ xsl/qandaset.mod.xsl Fri Apr 1 22:30:20 2005
c2d32021470555cd0dcf157634afaedbb34f62a5Rob Austein@@ -363,53 +363,4 @@
c2d32021470555cd0dcf157634afaedbb34f62a5Rob Austein </doc:template>
c2d32021470555cd0dcf157634afaedbb34f62a5Rob Austein <xsl:template match="revhistory" mode="qandatoc.mode"/>
c2d32021470555cd0dcf157634afaedbb34f62a5Rob Austein-<xsl:template name="question.answer.label">
c2d32021470555cd0dcf157634afaedbb34f62a5Rob Austein- <!-- variable: deflabel -->
c2d32021470555cd0dcf157634afaedbb34f62a5Rob Austein- <xsl:variable name="deflabel">
c2d32021470555cd0dcf157634afaedbb34f62a5Rob Austein- <!-- chck whether someone has a defaultlabel attribute -->
c2d32021470555cd0dcf157634afaedbb34f62a5Rob Austein- <xsl:choose>
c2d32021470555cd0dcf157634afaedbb34f62a5Rob Austein- <xsl:when test="ancestor-or-self::*[@defaultlabel]">
c2d32021470555cd0dcf157634afaedbb34f62a5Rob Austein- <xsl:value-of select="(ancestor-or-self::*[@defaultlabel])[last()]/@defaultlabel"/>
c2d32021470555cd0dcf157634afaedbb34f62a5Rob Austein- </xsl:when>
c2d32021470555cd0dcf157634afaedbb34f62a5Rob Austein- <xsl:otherwise>
c2d32021470555cd0dcf157634afaedbb34f62a5Rob Austein- <xsl:value-of select="latex.qanda.defaultlabel"/>
c2d32021470555cd0dcf157634afaedbb34f62a5Rob Austein- </xsl:otherwise>
c2d32021470555cd0dcf157634afaedbb34f62a5Rob Austein- </xsl:choose>
c2d32021470555cd0dcf157634afaedbb34f62a5Rob Austein- </xsl:variable>
c2d32021470555cd0dcf157634afaedbb34f62a5Rob Austein- <xsl:variable name="label" select="@label"/>
c2d32021470555cd0dcf157634afaedbb34f62a5Rob Austein- <xsl:choose>
c2d32021470555cd0dcf157634afaedbb34f62a5Rob Austein- <xsl:when test="$deflabel = 'qanda'">
c2d32021470555cd0dcf157634afaedbb34f62a5Rob Austein- <xsl:call-template name="gentext">
c2d32021470555cd0dcf157634afaedbb34f62a5Rob Austein- <xsl:with-param name="key">
c2d32021470555cd0dcf157634afaedbb34f62a5Rob Austein- <xsl:choose>
c2d32021470555cd0dcf157634afaedbb34f62a5Rob Austein- <xsl:when test="local-name(.) = 'question'">question</xsl:when>
c2d32021470555cd0dcf157634afaedbb34f62a5Rob Austein- <xsl:when test="local-name(.) = 'answer'">answer</xsl:when>
c2d32021470555cd0dcf157634afaedbb34f62a5Rob Austein- <xsl:when test="local-name(.) = 'qandadiv'">qandadiv</xsl:when>
c2d32021470555cd0dcf157634afaedbb34f62a5Rob Austein- <xsl:otherwise>qandaset</xsl:otherwise>
c2d32021470555cd0dcf157634afaedbb34f62a5Rob Austein- </xsl:choose>
c2d32021470555cd0dcf157634afaedbb34f62a5Rob Austein- </xsl:with-param>
c2d32021470555cd0dcf157634afaedbb34f62a5Rob Austein- </xsl:call-template>
c2d32021470555cd0dcf157634afaedbb34f62a5Rob Austein- </xsl:when>
c2d32021470555cd0dcf157634afaedbb34f62a5Rob Austein- <xsl:when test="$deflabel = 'label'">
c2d32021470555cd0dcf157634afaedbb34f62a5Rob Austein- <xsl:value-of select="$label"/>
c2d32021470555cd0dcf157634afaedbb34f62a5Rob Austein- </xsl:when>
c2d32021470555cd0dcf157634afaedbb34f62a5Rob Austein- <xsl:when test="$deflabel = 'number' and local-name(.) = 'question'">
c2d32021470555cd0dcf157634afaedbb34f62a5Rob Austein- <xsl:apply-templates select="ancestor::qandaset[1]" mode="number"/>
c2d32021470555cd0dcf157634afaedbb34f62a5Rob Austein- <xsl:choose>
c2d32021470555cd0dcf157634afaedbb34f62a5Rob Austein- <xsl:when test="ancestor::qandadiv">
c2d32021470555cd0dcf157634afaedbb34f62a5Rob Austein- <xsl:apply-templates select="ancestor::qandadiv[1]" mode="number"/>
c2d32021470555cd0dcf157634afaedbb34f62a5Rob Austein- <xsl:apply-templates select="ancestor::qandaentry" mode="number"/>
c2d32021470555cd0dcf157634afaedbb34f62a5Rob Austein- </xsl:when>
c2d32021470555cd0dcf157634afaedbb34f62a5Rob Austein- <xsl:otherwise>
c2d32021470555cd0dcf157634afaedbb34f62a5Rob Austein- <xsl:apply-templates select="ancestor::qandaentry" mode="number"/>
c2d32021470555cd0dcf157634afaedbb34f62a5Rob Austein- </xsl:otherwise>
c2d32021470555cd0dcf157634afaedbb34f62a5Rob Austein- </xsl:choose>
c2d32021470555cd0dcf157634afaedbb34f62a5Rob Austein- </xsl:when>
c2d32021470555cd0dcf157634afaedbb34f62a5Rob Austein- <xsl:otherwise>
c2d32021470555cd0dcf157634afaedbb34f62a5Rob Austein- <!-- nothing -->
c2d32021470555cd0dcf157634afaedbb34f62a5Rob Austein- </xsl:otherwise>
c2d32021470555cd0dcf157634afaedbb34f62a5Rob Austein- </xsl:choose>
c2d32021470555cd0dcf157634afaedbb34f62a5Rob Austein-</xsl:template>
c2d32021470555cd0dcf157634afaedbb34f62a5Rob Austein </xsl:stylesheet>