Loading ...
Sorry, an error occurred while loading the content.

Re: Probleme with FOP

Expand Messages
  • arianhojat2000
    it sounds like something is screwy in your template and a table cell somehow is being made without a table-row parent which is needed (prob being made straight
    Message 1 of 4 , Jun 17, 2005
    • 0 Attachment
      it sounds like something is screwy in your template and a table cell
      somehow is being made without a table-row parent which is needed
      (prob being made straight under table-body, hence the error).
      can u use Saxon or IE to output your translated xml doc straight
      into .fo, instead of using fop to translate straight to .pdf?
      i would look at the .fo doc and make sure all table cells have
      parents and if not, find out where in your template do you not make
      it.


      --- In XSL-FO@yahoogroups.com, "virgul4u" <virgul4u@y...> wrote:
      > Hi,
      >
      > Thanks a lot for your help!
      >
      > unfortunately that don't work but thanks for this correction I
      don't
      > have think to that case!
      >
      > I have always the same error:
      >
      > A table-cell must child of fo:table-row not fo:table-body
      >
      > Because I think Fop try to validate the xml with his DTD !
      > and no table-row is present so he cry! I'm right?
      >
      > Any other idea ? a work-around?
      >
      > Thanks in advance
      >
      > Thierry
      >
      >
      > --- In XSL-FO@yahoogroups.com, "arianhojat2000"
      > <arianhojat2000@y...> wrote:
      > >
      > > here is a test i ran. you dont check to see if its the last 'odd'
      > > node to close the row right, u only check even rows?
      > > like if this is missing,
      > > or ( position() = last() )
      > > it will error.
      > > hope that helps.
      > >
      > >
      > > ##################################
      > > <?xml version="1.0" encoding="UTF-8"?>
      > > <?xml-stylesheet type="text/xsl" href="test.xsl"?>
      > > <toto>
      > >
      > > <albert>1</albert>
      > > <albert>2</albert>
      > > <albert>3</albert>
      > > <albert>4</albert>
      > > <albert>5</albert>
      > > <albert>6</albert>
      > > <albert>7</albert>
      > > <albert>8</albert>
      > > <albert>9</albert>
      > >
      > > </toto>
      > > ##################################
      > > <?xml version="1.0" encoding="UTF-8"?>
      > > <xsl:stylesheet version="2.0"
      > > xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
      > >
      > > <xsl:output encoding="UTF-8" indent="yes" media-type="html" />
      > >
      > >
      > > <xsl:template match="/">
      > >
      > > <fo:table table-layout="fixed"
      > > xmlns:fo="http://www.w3.org/1999/XSL/Format">
      > > <fo:table-column column-width="100px"/>
      > > <fo:table-column column-width="100px"/>
      > >
      > >
      > > <fo:table-body>
      > >
      > > <xsl:for-each select="toto/albert">
      > >
      > > <xsl:if test="position() mod 2 !=0">
      > > <xsl:text disable-output-escaping="yes">
      > > <![CDATA[<fo:table-row>]]>
      > > </xsl:text>
      > > </xsl:if>
      > >
      > > <fo:table-cell>
      > > <xsl:value-of select="node()"/>
      > > </fo:table-cell>
      > >
      > > <xsl:if test="(position() mod 2 = 0) or (position() = last())">
      > > <xsl:text disable-output-escaping="yes">
      > > <![CDATA[</fo:table-row>]]>
      > > </xsl:text>
      > > </xsl:if>
      > >
      > > </xsl:for-each>
      > > </fo:table-body>
      > > </fo:table>
      > >
      > >
      > >
      > > </xsl:template>
      > >
      > >
      > >
      > >
      > >
      > >
      > > </xsl:stylesheet>
      > >
      > >
      > >
      > >
      > >
      > >
      > >
      > > --- In XSL-FO@yahoogroups.com, "virgul4u" <virgul4u@y...> wrote:
      > > > Hi,
      > > >
      > > > I use FOP
      > > >
      > > > I wan't to make a table with 2 columns and I want to make that
      > with
      > > > one for-each.
      > > >
      > > > I make so:
      > > >
      > > > <fo:table>
      > > > ...
      > > > ...
      > > > <fo:table-body>
      > > > <xsl:for-each select="toto/albert">
      > > > <xsl:if test="position() mod 2 !=0">
      > > > <xsl:text disable-output-escaping="yes"><![CDATA[<fo:table-
      row>]]
      > >
      > > > </xsl:text></xsl:if>
      > > > <fo:table-cell>
      > > > <xsl:value-of select="node()"/>
      > > > </fo:table-cell>
      > > > <xsl:if test="position() mod 2 =0">
      > > > <xsl:text disable-output-escaping="yes"><![CDATA[</fo:table-
      > row>]]>
      > > > </xsl:text></xsl:if>
      > > > </xsl:for-each>
      > > > </fo:table-body>
      > > > </fo:table>
      > > >
      > > > All work great if I parse with Msxml for example and after I
      > parse
      > > > with FOP for have my PDF
      > > >
      > > > But If I parse directly with FOP that make me an error:
      > > >
      > > > A table cell must child of fo:table-row not fo:table-body
      > > >
      > > > but at the end the file is correct so why FOP make me an
      error!
      > It
      > > > is while at the beginnig of the transformation FOP validate the
      > xml
      > > > with a DTD?
      > > >
      > > > Is there a work around for make this with FOP only ?
      > > >
      > > >
      > > > Thanks for your help
      > > > It's very appreciated
      > > >
      > > > ++
      > > >
      > > > Thierry
    Your message has been successfully submitted and would be delivered to recipients shortly.