belgoros
belgoros

Reputation: 3908

FOP fo:block-container: write-mode (No context info available)

I can't fugure out why GWT does not accept a variable declared as follows in XSL:

<xsl:variable name="writeMode">
        <xsl:choose>
            <xsl:when test="$lang ='fa'">
                <xsl:value-of select="'rl-tb'"/>
            </xsl:when>
            <xsl:otherwise>
                <xsl:value-of select="'lr-tb'"/>
            </xsl:otherwise>
        </xsl:choose>
    </xsl:variable>

<xsl:output method="xml" indent="yes"/>
    <xsl:template match="/">
        <fo:root>
            <fo:layout-master-set>
                <fo:simple-page-master master-name="A4-portrait"
                                       page-height="29.7cm" page-width="21.0cm" margin="2cm">
                    <fo:region-body/>
                </fo:simple-page-master>
            </fo:layout-master-set>
            <fo:page-sequence master-reference="A4-portrait">
                <fo:flow flow-name="xsl-region-body">
                    <fo:block-container write-mode="{$writeMode}" font-family="{$font}" language="{$lang}">
                        <fo:block>
                            بهترین قیمت دوچرخه کوهستان موجود است.
                        </fo:block>
                    </fo:block-container>
                </fo:flow>
            </fo:page-sequence>
        </fo:root>
    </xsl:template>

The error I get:

'Invalid property encountered on "fo:block-container": write-mode (No context info available)'

wg4.bean.ancestor.TechniqueException: Error generating PDF file : org.apache.fop.fo.ValidationException: Invalid property encountered on "fo:block-container": write-mode (No context info available)

Any ideas ? Thank you.

Upvotes: 0

Views: 1133

Answers (1)

belgoros
belgoros

Reputation: 3908

Fixed it. There was a typo in use of write-mode option:

instead of

write-mode="{$writeMode}"

it should be

writing-mode="{$writingMode}".

Of course, I renamed the variable value assignement as follows:

<xsl:variable name="writingMode">
        <xsl:if test="$langue='fa'">
            <xsl:value-of select="'rl-tb'"/>
        </xsl:if>
    </xsl:variable>

because the default value is lt-tb. HTH

Upvotes: 0

Related Questions