Altova Mailing List Archives


[xsl] Table error

From: "James Steven" <JSteven@--------------------->
To:
Date: 9/9/2004 3:36:00 PM
Hello
I have the following xml:

<root>
  <Table name="abc">
    <Column name="987">
      <Value>h</Value>
    </Column>
    <Column name="123">
      <Value>a</Value>
    </Column>
    <Column name="456">
      <Value>g</Value>
    </Column>
  </Table>

  <Table name="ghi">
    <Column name="jkl">
      <Value>5</Value>
    </Column>
  </Table>

  <Table name="mno">
    <Column name="pqr">
      <Value>7</Value>
    </Column>
   <Column name="1011">
      <Value>p</Value>
    </Column>
  </Table>

  <Table name="stu">
    <Column name="vwx">
      <Value>3</Value>
    </Column>
  </Table>
</root>

Using this I would like to create a table like that below:

abc
Column   Value
987       h
123       a
456       g

ghi
Column   Value
jkl       5

mno
Column   Value
pqr	    7
1011      p

stu
Column   Value
vwx       3

At the moment I have the xsl-fo shown below which keeps producing a
'Expecption in thread "main" jave.lang.OutofMemoryError' at the command
prompt when run with the xml.  It works if I remove the 'Column' and
'Values' headings in xsl or if I leave those in and remove each Table name.
Please mail back if you can suggest how I can resolve this!  Thanks.


<xsl:template match="ROOT">
			<fo:root>

				 <fo:page-sequence master-reference="first.page">



<!-- ================================ PAGE BODY
================================-->
<fo:flow flow-name="xsl-region-body">
<fo:block xsl:use-attribute-sets="orderlist.block">
<fo:block xsl:use-attribute-sets="orderlist.table.block">
<fo:table table-layout="fixed">
<fo:table-column column-width="100mm"/>
<fo:table-column column-width="100mm"/>

<fo:table-body>
<xsl:for-each select="Table">
 <fo:table-row>
    <fo:table-cell
xsl:use-attribute-sets="orderlist.table.detail.textcolumns">
	 <fo:block xsl:use-attribute-sets="orderlist.table.detail.blocks">
		 <xsl:value-of select="@Name"/>
	    </fo:block>
	   </fo:table-cell>
      </fo:table-row>
     <fo:table-row>
         <fo:table-cell
xsl:use-attribute-sets="orderlist.table.detail.textcolumns">
              <fo:block text-align="center" font-size="10pt"
font-family="serif">
		     Column
	        </fo:block>
	    </fo:table-cell>
	   <fo:table-cell
xsl:use-attribute-sets="orderlist.table.detail.textcolumns">
		 <fo:block text-align="center" font-size="10pt" font-family="serif">
			Values
		</fo:block>
	   </fo:table-cell>
      </fo:table-row>
<xsl:for-each select="Column">
   <fo:table-row>
	  <fo:table-cell
xsl:use-attribute-sets="orderlist.table.detail.textcolumns">
	     <fo:block xsl:use-attribute-sets="orderlist.table.detail.blocks">
		    <xsl:value-of select="@Name"/>
	       </fo:block>
	  </fo:table-cell>
	 <fo:table-cell
xsl:use-attribute-sets="orderlist.table.detail.textcolumns">
	       <fo:block xsl:use-attribute-sets="orderlist.table.detail.blocks">
		      <xsl:value-of select="./Value"/>
		 </fo:block>
	  </fo:table-cell>
    </fo:table-row>
</xsl:for-each>
</xsl:for-each>
    </fo:table-body>
</fo:table>
</fo:block>
</fo:block>

</fo:flow>
</fo:page-sequence>
</fo:root>
</xsl:template>

Disclaimer

These Archives are provided for informational purposes only and have been generated directly from the Altova mailing list archive system and are comprised of the lists set forth on www.altova.com/list/index.html. Therefore, Altova does not warrant or guarantee the accuracy, reliability, completeness, usefulness, non-infringement of intellectual property rights, or quality of any content on the Altova Mailing List Archive(s), regardless of who originates that content. You expressly understand and agree that you bear all risks associated with using or relying on that content. Altova will not be liable or responsible in any way for any content posted including, but not limited to, any errors or omissions in content, or for any losses or damage of any kind incurred as a result of the use of or reliance on any content. This disclaimer and limitation on liability is in addition to the disclaimers and limitations contained in the Website Terms of Use and elsewhere on the site.