Hi,
I'm getting a strange fop error that I can't figure out why I'm getting it.
The error is this:
ERROR: 'Error(Unknown location): fo:block is not a valid child
element of fo:table-row.'
My XSL is at the bottom. The xml is aggregated from calls inside of a
for-loop, which transforms the xm into fo and appends the resulting fo
to an fo document that gets transformed into PDF at the end. What I
am trying to do is pass a value called componentType, which gets
tested in the xsl. If the value is STANDALONE_SUMMARY, then the
current xml generates a header and a table. If it is SUMMARY, then it
creates a tablerow and the Java appends that to the table created in
STANDALONE_SUMMARY. My problem is that there are no fo:blocks that
are outside of the table cells, so I don't understand why this
exception is being thrown. Can anyone help me? Just so you know, the
lone table-cells in my otherwise are appended to a table-row node that
is created in Java.
<xsl:template match="ts:testscript">
<fo:block xmlns:fo="http://www.w3.org/1999/XSL/Format"
space-after="10mm">
<xsl:choose>
<xsl:when test="/descendant::componentType='SUMMARY' or
/descendant::componentType='STANDALONE_SUMMARY'">
<xsl:choose>
<xsl:when
test="/descendant::componentType='STANDALONE_SUMMARY'">
<fo:block font-size="14pt" space-before="2mm"
space-after="2mm">Summary: Testscript</fo:block>
<fo:table border="0.5pt solid black"
text-align="center">
<fo:table-header>
<fo:table-cell>
<fo:block
font-weight="bold">ID</fo:block>
</fo:table-cell>
<fo:table-cell>
<fo:block
font-weight="bold">Name</fo:block>
</fo:table-cell>
<fo:table-cell>
<fo:block
font-weight="bold">State</fo:block>
</fo:table-cell>
<fo:table-cell>
<fo:block
font-weight="bold">Type</fo:block>
</fo:table-cell>
</fo:table-header>
<fo:table-body>
<fo:table-row>
<fo:table-cell padding="3pt"
border="0.5pt solid black">
<fo:block font-size="10pt"> <xsl:number/>
</fo:block>
</fo:table-cell>
<fo:table-cell padding="6pt"
border="0.5pt solid black">
<fo:block font-size="10pt"><xsl:value-of
select="ns3:title"/></fo:block>
</fo:table-cell>
<fo:table-cell padding="6pt" border="0.5pt
solid black">
<fo:block font-size="10pt">
<xsl:choose>
<xsl:when
test="ns4:state='com.ibm.rqm.planning.common.underreview'">
Under Review
</xsl:when>
<xsl:when
test="ns4:state='com.ibm.rqm.planning.common.new'">
Draft
</xsl:when>
<xsl:when
test="ns4:state='com.ibm.rqm.planning.common.approved'">
Approved
</xsl:when>
</xsl:choose>
</fo:block>
</fo:table-cell>
<fo:table-cell padding="6pt" border="0.5pt
solid black">
<fo:block font-size="10pt"><xsl:value-of
select="ts:scripttype"/></fo:block>
</fo:table-cell>
</fo:table-row>
</fo:table-body>
</fo:table>
</xsl:when>
<xsl:otherwise>
<fo:table-cell padding="3pt"
border="0.5pt solid black">
<fo:block font-size="10pt"> <xsl:number/>
</fo:block>
</fo:table-cell>
<fo:table-cell padding="6pt"
border="0.5pt solid black">
<fo:block font-size="10pt"><xsl:value-of
select="ns3:title"/></fo:block>
</fo:table-cell>
<fo:table-cell padding="6pt" border="0.5pt
solid black">
<fo:block font-size="10pt">
<xsl:choose>
<xsl:when
test="ns4:state='com.ibm.rqm.planning.common.underreview'">
Under Review
</xsl:when>
<xsl:when
test="ns4:state='com.ibm.rqm.planning.common.new'">
Draft
</xsl:when>
<xsl:when
test="ns4:state='com.ibm.rqm.planning.common.approved'">
Approved
</xsl:when>
</xsl:choose>
</fo:block>
</fo:table-cell>
<fo:table-cell padding="6pt" border="0.5pt
solid black">
<fo:block font-size="10pt"><xsl:value-of
select="ts:scripttype"/></fo:block>
</fo:table-cell>
</xsl:otherwise>
</xsl:choose>
</xsl:when>
<xsl:otherwise>
<fo:marker marker-class-name="artifactUri">
<fo:block font-size="8pt" color="black"><xsl:value-of
select="/descendant::originUrl"/></fo:block>
</fo:marker>
<fo:block keep-together.within-page=0>
<fo:block font-size="14pt" space-before="2mm"
space-after="2mm">Testscript: <xsl:value-of
select="ns3:title"/></fo:block>
<fo:block font-size="12pt" space-after="2mm">Type: <xsl:value-of
select="ts:scripttype"/></fo:block>
<fo:block font-size="12pt" space-after="4mm">Description:
<xsl:value-of select="ns3:description"/></fo:block>
<xsl:apply-templates select="ts:steps"/>
</fo:block>
</xsl:otherwise>
</xsl:choose>
</fo:block>
</xsl:template>
--
Sam Fuqua
ΣΝ ΘΗ 454
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]