ASPN ActiveState Programmer Network
ActiveState
/ Home / Perl / PHP / Python / Tcl / XSLT /
/ Safari / My ASPN /
Cookbooks | Documentation | Mailing Lists | Modules | News Feeds | Products | User Groups


Recent Messages
List Archives
About the List
List Leaders
Subscription Options

View Subscriptions
Help

View by Topic
ActiveState
.NET Framework
Open Source
Perl
PHP
Python
Tcl
Web Services
XML & XSLT

View by Category
Database
General
SOAP
System Administration
Tools
User Interfaces
Web Programming
XML Programming


MyASPN >> Mail Archive >> xsl-list
xsl-list
[xsl] Table error
by James Steven other posts by this author
Sep 9 2004 3:33PM messages near this date
Re: AW: AW: [xsl] xhtml output formating problems / passing through pre defined static xhtml | Re: [xsl] Table error
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> 



--+------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe@[...].com> 
--+--
Thread:
James Steven
J.Pietschmann

Privacy Policy | Email Opt-out | Feedback | Syndication
© ActiveState Software Inc. All rights reserved