XSL-FO inline problem...
843834May 15 2003 — edited May 15 2003Hello all,
I am writing an XSL-FO to output a piece of XML to PDF using FOP. The structure of the XML is as follows:
<ROOT>
<SUBJECT>some <hlt>piece</hlt> of text</SUBJECT>
<BODY>
<SUBJECT>another <hlt>piece</hlt> of text</SUBJECT>
</BODY>
</ROOT>
I have an fo:inline FO that is supposed to bold all words contained in the <hlt> tags. It works, except for the nested BODY/SUBJECT element. I think this has to do with the fact that there are two elements in the xml with the same name, but at different levels. I get the text outputted, but the <hlt>piece</hlt> found in the nested SUBJECT is not bolded. Below is the FO that I am using. Any thoughts?
<xsl:template match="SUBJECT">
<fo:block font-size="14pt" text-align="left" padding-bottom="5pt" padding-top="5pt">SUBJECT</fo:block>
<fo:block xsl:use-attribute-sets="bodyAtt"><xsl:apply-templates/></fo:block>
</xsl:template>
<xsl:template match="BODY">
<fo:block font-size="14pt" text-align="left" padding-bottom="5pt" padding-top="5pt">BODY</fo:block>
<fo:block text-align="justify"><xsl:value-of select="."/></fo:block>
</xsl:template>
<xsl:template match="//hlt">
<fo:inline font-weight="bold"><xsl:apply-templates/></fo:inline>
</xsl:template>
Thanks!
John