cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From anandhthiyagarajan <anandhthiyagara...@gmail.com>
Subject Table manipulation
Date Thu, 21 Jan 2010 08:49:46 GMT

Hi everybody

    I am stuck up with an issue in manipulating the table.



Consider the below XML and XSL

<root>
    <roadmap>
        <years>
            <year>2009</year>
            <quarters>
                <quarter>Q3</quarter>
                <requirements>
                    <requirement>Mp3Player</requirement>
                </requirements>
                <requirements>
                    <requirement>Mp3Player</requirement>
                </requirements>
                <requirements>
                    <requirement>DataCable</requirement>
                </requirements>
                <requirements>
                    <requirement>Mp3Player</requirement>
                </requirements>
                <requirements>
                    <requirement>Mp3Player</requirement>
                </requirements>
                <requirements>
                    <requirement>Bluetooth</requirement>
                </requirements>
            </quarters>
            <quarters>
                <quarter>Q4</quarter>
                <requirements>
                    <requirement>DataCable</requirement>
                </requirements>
                <requirements>
                    <requirement>MemoryCard</requirement>
                </requirements>
                <requirements>
                    <requirement>InbuiltCam</requirement>
                </requirements>
            </quarters>
        </years>
    </roadmap>
</root>


XSL:

<xsl:template match="root/roadmap">
    <fo:block space-before='2mm'>
      <fo:block font-size="10pt" color="black" font-weight="bold"
increment-by="1.1.1"  space-before="0.54in" space-after="2pt" >
        ROADMAP INFORMATION
      </fo:block>
      <fo:block space-before='2mm'>
      </fo:block>
      <fo:table  border-collapse="collapse"  font-size="9pt">
        <fo:table-column column-width="1in"/>
        <fo:table-column column-width="50%"/>
        <fo:table-column column-width="50%"/>
        <fo:table-column column-width="50%"/>
        <fo:table-column column-width="50%"/>
        <fo:table-header color="black" background-color="rgb(39,64,139)"
                         font-weight="bold">
          <fo:table-row>
            <fo:table-cell padding="2pt" border="1pt solid black"
text-align="center">
              <fo:block>YEAR</fo:block>
            </fo:table-cell>
            <fo:table-cell padding="2pt" border="1pt solid black"
text-align="center">
              <fo:block>Q1</fo:block>
            </fo:table-cell>
            <fo:table-cell padding="2pt" border="1pt solid black"
text-align="center">
              <fo:block>Q2</fo:block>
            </fo:table-cell>
            <fo:table-cell padding="2pt" border="1pt solid black"
text-align="center">
              <fo:block>Q3</fo:block>
            </fo:table-cell>
            <fo:table-cell padding="2pt" border="1pt solid black"
text-align="center">
              <fo:block>Q4</fo:block>
            </fo:table-cell>
          </fo:table-row>
        </fo:table-header>
        <fo:table-body>
          <xsl:for-each select="years">
            <fo:table-row>
              <fo:table-cell padding="2pt" border="1pt solid black"
background-color="rgb(255,255,255)" text-align="center">
                <fo:block><xsl:value-of select="year"/></fo:block>
              </fo:table-cell>
              <xsl:for-each select="quarters">
                <fo:table-cell padding="2pt" border="1pt solid black"
background-color="rgb(255,255,255)" text-align="center">
                  <fo:block><xsl:value-of select="."/></fo:block>
                </fo:table-cell>
                <fo:table-cell padding="2pt" border="1pt solid black"
background-color="rgb(255,255,255)" text-align="center">
                  <fo:block><xsl:value-of select="requirement"/></fo:block>
                </fo:table-cell>
                <fo:table-cell padding="2pt" border="1pt solid black"
background-color="rgb(255,255,255)" text-align="center">
                  <fo:block><xsl:value-of select="requirement"/></fo:block>
                </fo:table-cell>
                <fo:table-cell padding="2pt" border="1pt solid black"
background-color="rgb(255,255,255)" text-align="center">
                  <fo:block><xsl:value-of select="requirement"/></fo:block>
                </fo:table-cell>
              </xsl:for-each>
            </fo:table-row>
          </xsl:for-each>
        </fo:table-body>
      </fo:table>
    </fo:block>
  </xsl:template>


I am attaching a file with this which contain the required ouptut.


http://old.nabble.com/file/p27254530/Table.doc Table.doc 



But i am not getting that output instead it throws a exception. Please let
me know if i am missing something.

Any help would be greatly appreciated.



Thanks in Advance

Anandh
-- 
View this message in context: http://old.nabble.com/Table-manipulation-tp27254530p27254530.html
Sent from the Cocoon - Dev mailing list archive at Nabble.com.


Mime
View raw message