[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

RE: Trouble with tables

Subject: RE: Trouble with tables
From: Michael.Kay@xxxxxxx
Date: Fri, 19 Feb 1999 11:10:41 -0000
trouble with tables
>I'm now trying to start another set of rows every time I reach four 
>term/meaning sets, so that I don't send my table off into oblivion.

There might be a way using Microsoft' proprietary XSL extensions but if
there is then I can't see it.

You could solve the problem very easily with <plug>SAXON</plug>. Preprocess
the input using a custom Java element handler to add a <GROUP> element
around every four terms, as follows:

<xsl:template match="*" handler="com.icl.saxon.ElementCopier">
<xsl:template match="TERMS">
	<TERMS><GROUP><xsl:apply-templates/></GROUP></TERMS>
</xsl:template>
<xsl:template match="TERM" handler="com.icl.saxon.NumberHandler"/>
<xsl:template match="TERM" handler="GroupsOfFour"/>

with the Java class:

class GroupsOfFour extends com.icl.saxon.ElementCopier {
public void startElement(ElementInfo e) {
	int i = Integer.parseInt(e.getAttribute("saxon:nr"));
	if (i>0 && (i%4 == 0)) e.write("</GROUP><GROUP>");
	super.startElement(e);
}}

(Trivia such as exception handling omitted for clarity).
Creating your tables from this preprocessed file is then trivial using any
XSL processor.



Mike Kay
SAXON is on http://home.iclweb.com/icl2/mhkay/saxon.html 
An error-fix release, version 4.01, was posted last night.


 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list


Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.