mdichi |
Newbie |
|
|
|
|
None Specified |
|
Tuesday, April 5, 2016 |
Saturday, October 22, 2016 1:21:42 AM |
5 [0.03% of all post / 0.00 posts per day] |
|
Anyone from Altova care to comment or should I assume this is a bug?
|
Any thoughts on this, please?
|
I have some dynamically generated text that is formatted with HTML using just BOLD (<b>) tags. I've written some XSLT to convert the bold tags to the FO equivalent (<fo:inline font-weight='bold'></fo:inline>). I escape the converted text through using SV_OutputFormat for the appropriate format (HTML or FO/PDF). It doesn't seem to work.
Here is a simple User Defined Block that demonstrates the problem.
Code:<xsl:variable name="test"> <xsl:choose> <xsl:when test="$SV_OutputFormat = 'PDF'"> <xsl:value-of select="'<fo:inline font-weight="bold">Hello World</fo:inline>'"/> </xsl:when> <xsl:otherwise> <xsl:value-of select="'<b>Hello World</b>'"/> </xsl:otherwise> </xsl:choose> </xsl:variable>
<xsl:value-of select="$test" disable-output-escaping="yes"/>
This last line correctly displays text as bold in HTML. However, it doesn't show bold text in PDF. Instead it shows the FO markup in the PDF, like this: <fo:inline font-weight="bold">Hello World</fo:inline>
Is it possible to escape FO through to PDF? If so, why doesn't this work?
Thanks.
|
I believe the initial question stated the problem quite clearly.
I have some text like "Hello, how are you <b>today</b>.".
I would like to output this as HTML and retain the bold styling around "today". For PDF I will remove the <b> and "</b>" tags.
How can I output this conditionally based on the output (HTML or PDF)? The conditional output option only allows varying the xpath. I see no way to place XSL into the window to allow my being able call a template to remove the HTML tags.
|
How can I vary the output based on the output format (HTML or PDF). NOTE: I don't want to vary what is output, just the style. In particular, I have some stylized HTML markup (with bold and italics tags). For HTML I want to output that text with disable output escaping like this:
<xsl:value-of select="/report/sometext" disable-output-escaping="yes"/>
For PDF I want to output the text, which I will scrub out all the HTML markup, like this:
<xsl:call-template name="scrub"> <xsl:with-param name="str" select="/report/sometext"/> </xsl:call-template>
Of course I can enclose an element with an "output-based condition", but this is of no use because it only allows varying the xpath based on the output. I don't see how to vary what is output.
|
|