Geldersma, Matt (AGRN) wrote:
This snippet generates the error IllegalStateException: endElement()
called for fo:block where there is no current element. Specifically the
line in bold. Any ideas?
Getting into wild guess mode: It's eiter the fo:inline, or FOP
wont grok the $fontsize font size.
You might get better help if you do the following:
- State the FOP version you use.
- Post a FO snippet, preferably a small, complete, self contained
FO docment instead of an XSLT snippet. It's much easier to track
down error messages if there is a FO to use as input than for
an XSLT file, in particular if there is no source XML and
various conditional statements in the transformation.
Posting a FO has the additional advantage that you wont expose
an XSLT programming style to the public which isn't exactly
known as "best practice". Some comments:
<xsl:variable name="the_id"><xsl:value-of
select="objectattributes/absolutenumber" /></xsl:variable>
This unnecessarily produces a RTF. You should prefer using the "select"
attribute on xsl:variable like
<xsl:variable name="the_id" select="objectattributes/absolutenumber"/>
in such cases.
<fo:block font-family="Helvetica" font-weight="bold"
color="{$text_color}" font-size="$fontSize" space-before="10pt"
^^^^^^^^
I guess you are missing the braces around $fontSize. FOP will
probably choke on this value.
<xsl:variable name="objhead"><xsl:value-of
select="translate(objectheading,'abcdefghijklmnopqrstuvwxyz','ABCDEFGHIJ
KLMNOPQRSTUVWXYZ')"/></xsl:variable>
Same as above. Also, using a variable instead of inlining the code
doesn't add value in this case.
<xsl:value-of select="concat(@objectnumber, '. ',
$objhead )" />
Most people would prefer the following equivalent:
<xsl:value-of select="@objectnumber"/>
<xsl:text>.</xsl:text>
<xsl:value-of select="$objhead"/>
<xsl:value-of select="@objectnumber"/>
<xsl:value-of select="concat(' ', objectheading )"/>
Same as above.
J.Pietschmann
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]