How do I style an embedded <strong> in the text from the XML input?
mailinglists <[email protected]>
| Newsgroups | gmane.text.xml.fop.user |
|---|---|
| Message-ID | <[email protected]> |
I have the following XML (just a snippet, but should be enough). There is exactly one <xsl-template> matching the root. Everything is taken from there. A document can contain many sections and a section can contain many textblocks.
Note: in the example given the section/textblocks/textblock/text contains <strong>...</strong>
<sections>
<section>
<sectionTitle>
Contract Validity
</sectionTitle>
<textBlocks>
<textblock>
<text>This contract is valid for a period of <strong>18 months</strong> and the .... be 7,400.00.</text>
</textblock>
</textBlocks>
<accepted>false</accepted>
<acceptanceText>
I certify I have ... agree to the above.
</acceptanceText>
</section>
</sections>
and the respective fragment from the XSL
<xsl:for-each select="sections/section">
<fo:block space-after="0.7em" text-decoration="underline">
<xsl:value-of select="sectionTitle"/>
</fo:block>
<xsl:for-each select="textBlocks/textblock">
<fo:block space-after="0.7em">
<xsl:value-of select="text"/>
</fo:block>
</xsl:for-each>
</xsl:for-each>
How can I replace the <strong> by the proper <fo:font-weight=“bold”> tags during processing?
I have been reading up on xsl:apply-templates but have only been successful to *additionally* show the text “18 months” in bold either before or after the selected text, but never replacing the "<strong>18 months</strong>” inline by bolded text. However I was able to get rid of the strong-tags so that the text in the PDF just read “...period of 18 months and the...” without any visible boldness.
Thanks a lot
---markus---