Hi,
I have the following XML that contains some html formatting tags embedded in some text block:
<editorial>
This is some editorial text
<p>this is in a new paragraph<p/>
<p>this is a paragraph with
<u> underlined text <u/> this is the end of the paragraph
<p/>
<editorial>
I cant figure out how to process the paragraph text (and non paragraph text) and then process underline text within the paragraph (and text outside the paragraph). to create fo output like:
<fo:block>
This is some editorial text
<fo:block space-before="5mm"/>
this is in a new paragraph
<fo:block space-before="5mm"/>
<fo:block space-before="5mm"/>
this is a paragraph with <fo:inline text-decoration="underline">underliend text</fo:inline>this is the end of the paragraph
<fo:block space-before="5mm"/>
</fo:block>
In order to get something like:
This is some editorial text
this is in a new paragraph
this is a paragraph with underliend text this is the end of the paragraph
with underlined text being underlined.
I've spent a long time messing around with this, the closest I got is handling the paragraphs using
<xsl:template match="entry" mode="documentText">
<xsl:apply-templates select="documentText/editorial" mode="documentText"/>
</xsl:template>
<xsl:template match="p" mode="documentText">
<fo:block xsl:use-attribute-sets="paragraph"/>
<xsl:value-of select="."/>
<fo:block xsl:use-attribute-sets="paragraph"/>
</xsl:template>
The issue is that <xsl:value-of select="."/> selects the current node value (the text) within the paragraph, but I cant figure out how to then check this for underlined text within this text block.
Im considering doing this in java since I alread scan for strings such as & and replace with the hex value form.
Cheers
Tim