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

3 elements on the same line

Expand Messages
  • bharathi kongara
    Hi I ve the following table - I want to put the QuestionNo, QuestionText, and QuestionScore on the same line in the resulting output.
    Message 1 of 2 , Sep 11, 2005
    • 0 Attachment
      Hi

      I've the following table - I want to put the
      QuestionNo, QuestionText, and QuestionScore on the
      same line in the resulting output.

      <xsl:template match="Question">
      <fo:table table-layout="fixed" width="100%" >

      <fo:table-column
      column-width="proportional-column-width(1)"/>

      <fo:table-body space-after.optimum="15pt">
      <fo:table-row padding-bottom="0.5em">
      <fo:table-cell>

      <xsl:apply-templates select="QuestionNo"/>

      </fo:table-cell>
      </fo:table-row>
      <fo:table-row keep-with-previous="always">
      <fo:table-cell>

      <xsl:apply-templates
      select="QuestionType"/>

      </fo:table-cell>
      </fo:table-row>
      <fo:table-row keep-with-previous="always">
      <fo:table-cell>

      <xsl:apply-templates
      select="QuestionScore"/>

      </fo:table-cell>
      </fo:table-row>
      <fo:table-row keep-with-previous="always">
      <fo:table-cell>

      <xsl:apply-templates
      select="QuestionText"/>

      </fo:table-cell>
      </fo:table-row>
      </fo:table-body>

      </fo:table>
      </xsl:template>

      I tried with columns, didn't work(I'm using FOP to
      render the o/p). Any ideas???

      Thanks,
      Bharathi




      __________________________________________________
      Do You Yahoo!?
      Tired of spam? Yahoo! Mail has the best spam protection around
      http://mail.yahoo.com
    • Chris Bowditch
      ... ... In order to get the QuestionNo, QuestionText and QuestionScore onto the same line you must put them in the same table row. Your example above
      Message 2 of 2 , Sep 12, 2005
      • 0 Attachment
        bharathi kongara wrote:
        > Hi
        >
        > I've the following table - I want to put the
        > QuestionNo, QuestionText, and QuestionScore on the
        > same line in the resulting output.
        >

        <snip/>

        >
        > I tried with columns, didn't work(I'm using FOP to
        > render the o/p). Any ideas???

        In order to get the QuestionNo, QuestionText and QuestionScore onto the
        same line you must put them in the same table row. Your example above
        shows each item in its own row. So you must declare 3 columns in your table:

        <fo:table>
        <fo:table-column column-width="proportional-column-width(1)"/>
        <fo:table-column column-width="proportional-column-width(1)"/>
        <fo:table-column column-width="proportional-column-width(1)"/>
        <fo:table-body>
        <fo:table-row>
        <fo:table-cell>
        <xsl:apply-templates select="QuestionNo"/>
        </fo:table-cell>
        <fo:table-cell>
        <xsl:apply-templates select="QuestionText"/>
        </fo:table-cell>
        <fo:table-cell>
        <xsl:apply-templates select="QuestionScore"/>
        </fo:table-cell>
        </fo:table-row>
        </fo:table-body>
        </fo:table>

        You say you have tried columns? If you have tried this already then the
        problem is likely to lie with your XSL not working for your input XML.
        However, I cannot comment on this as you haven't shown your input XML.
        Try running the xalan.bat file that comes with FOP to generate the
        intermediate FO. This will help you identify whether your problem is
        with your XML and XSL or the XSL-FO.

        Chris
      Your message has been successfully submitted and would be delivered to recipients shortly.