I'm trying to create a template that will make inline references look like this:
My sentence.(1) My other sentence. (2, 3)
Using this tempate:
Unfortunately the references end up looking like this:
My sentence.(1, My other sentence. 2, 3)
I think this is because the XPath I'm using does not take into account text nodes. How can I modify the test attributes in [tt]<xsl:if />[/tt] to account for the text in between the references.
My sentence.(1) My other sentence. (2, 3)
Using this tempate:
Code:
<!-- Match Ref -->
<xsl:template match="ref">
<fo:inline baseline-shift="4" font-size="7.5pt">
<xsl:if test="not( preceding-sibling::ref )">
<fo:inline>
<xsl:text>(</xsl:text>
</fo:inline>
</xsl:if>
<fo:inline>
<xsl:copy-of select="text()" />
</fo:inline>
<xsl:if test="following-sibling::ref">
<xsl:text>, </xsl:text>
</xsl:if>
<xsl:if test="not( following-sibling::ref )">
<fo:inline>
<xsl:text>)</xsl:text>
</fo:inline>
</xsl:if>
</fo:inline>
</xsl:template>
Unfortunately the references end up looking like this:
My sentence.(1, My other sentence. 2, 3)
I think this is because the XPath I'm using does not take into account text nodes. How can I modify the test attributes in [tt]<xsl:if />[/tt] to account for the text in between the references.