Skip to Main Content

Java EE (Java Enterprise Edition) General Discussion

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

XSL-FO inline problem...

843834May 15 2003 — edited May 15 2003
Hello 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
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Jun 12 2003
Added on May 15 2003
1 comment
417 views