OASIS Mailing List ArchivesView the OASIS mailing list archive below
or browse/search using MarkMail.

 


Help: OASIS Mailing Lists Help | MarkMail Help

docbook-apps message

[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [List Home]


Subject: multiple xreferences: [1,2,3] and [4]



Here's the thing. I need to show the biblio references like this:

"one reference [1] and the some more [2, 3, 4] and so on..."

I've successfully edited the <xsl:template match="xref" name="xref"> and it 
does work with one exception: If there are two on more single references in 
one paragraph, right square bracket is missing (=> foo bar [1 lorem ipsum 
2]). 

Problem is that I haven't found a way to test whether xreferences are right 
next to each other or if there is some text between.

Here's what I've managed to do so far:

<!-- show multiple references like: [1, 2, 3] -->
<xsl:otherwise>
    <xsl:if test="not(parent::citation)">
        <!-- set "[" only if first xref entry -->
        <xsl:choose>
            <xsl:when test="not(preceding-sibling::xref)">
                <xsl:apply-templates select="$target" mode="xref-to-prefix"/>
            </xsl:when>    
            <!-- otherwise put space -->
            <xsl:otherwise>
                <xsl:text> </xsl:text>
            </xsl:otherwise>
        </xsl:choose>    
    </xsl:if>

    ....

    <xsl:if test="not(parent::citation)">
        <!-- set "]" only if last xref entry -->
        <xsl:choose>
            <xsl:when test="not(following-sibling::xref)">
                <xsl:apply-templates select="$target" mode="xref-to-suffix"/>
            </xsl:when>    
            <!-- otherwise put comma -->
            <xsl:otherwise>
                <xsl:text>, </xsl:text>
            </xsl:otherwise>
       </xsl:choose>
    </xsl:if>   
</xsl:otherwise>

Regards,
Juha


[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [List Home]