IMPORTANT:
this is not a Support Forum! Experienced users might answer from time to time questions posted here. If you need a professional and reliable answer, or if you want to report a bug, please contact Altova Support instead.

Profile: mdichi
About
User Name: mdichi
Forum Rank: Newbie
Real Name:
Location
Occupation:
Interests:
Gender: None Specified
Statistics
Joined: Tuesday, April 5, 2016
Last Visit: Saturday, October 22, 2016 1:21:42 AM
Number of Posts: 5
[0.03% of all post / 0.00 posts per day]
Avatar
Last 10 Posts
Topic: Output escaping to HTML and PDF
Posted: Saturday, October 22, 2016 1:21:42 AM
Anyone from Altova care to comment or should I assume this is a bug?
Topic: Output escaping to HTML and PDF
Posted: Saturday, October 15, 2016 12:12:35 AM
Any thoughts on this, please?
Topic: Output escaping to HTML and PDF
Posted: Friday, October 14, 2016 6:39:34 AM
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="'&lt;fo:inline font-weight=&quot;bold&quot;&gt;Hello World&lt;/fo:inline&gt;'"/>
        </xsl:when>
        <xsl:otherwise>
            <xsl:value-of select="'&lt;b&gt;Hello World&lt;/b&gt;'"/>
        </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.
Topic: Conditional based output
Posted: Tuesday, April 5, 2016 11:55:33 PM
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.
Topic: Conditional based output
Posted: Tuesday, April 5, 2016 12:35:12 AM
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.

Use of the Altova User Forum(s) is governed by the Altova Terms of Use.