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

RE: FW: xsl code to create tables of different number

Subject: RE: FW: xsl code to create tables of different number columns and rows
From: "Martie Kruger" <MartinaKr@xxxxxxxxxxxxxxx>
Date: Fri, 20 May 2005 09:20:14 +0200
create table in code
Hi Aron
I am sorry, I provided the wrong code - please look at this again. In the
first table there is 3 columns, and in the second table 2. Throughout the book
there can be a number of tables with different amount of columns/rows. Thus, I
have to create a template that can interpret the   cols="?"  attribute and for
each instance create a table with that amount of columns. Do I describe it
right? I am not good (yet) with xml or html. If I create an html table first,
how do I then apply the tgroup/@cols to that?

<table>
<tgroup cols="3"><colspec colname="col1"/><colspec colname="col2"/><colspec
colname="col3"/>
<tbody>
<row>
<entry>column1rowa</entry>
<entry>column2rowa</entry>
<entry>column3rowa</entry>
</row>
<row>
<entry>column1rowb</entry>
<entry>column2rowb</entry>
<entry>column3rowb</entry>
</row>
</tbody>
</tgroup>
</table>
<table>
<tgroup cols="2"><colspec colname="col1"/><colspec colname="col2"/>
<tbody>
<row>
<entry>column1rowa</entry>
<entry>column2rowa</entry>
</row>
<row>
<entry>column1rowb</entry>
<entry>column2rowb</entry>
</row>
<row>
<entry>column1rowc</entry>
<entry>column2rowc</entry>
</row>
</tbody>
</tgroup>
</table>

Date: Thu, 19 May 2005 12:46:03 +0000
To: xsl-list@xxxxxxxxxxxxxxxxxxxxxx
From: "Aron Bock" <aronbock@xxxxxxxxxxx>
Subject: RE:  FW: xsl code to create tables of different number columns
and rows
Message-ID: <BAY107-F197EA4D8C6FA66A7048580D8080@xxxxxxx>

Martie, you don't mention how you want output to be formatted.  Since there
are fewer tgroup/@cols than row/entry I assume you want to coalesce one or
more of the latter, nd use colspan on the resulting output.  Thus consider
looking at the tgroup/@cols metadata to output the appropriate HTML colspan.

As a respondent suggested in a different thread, first create your output
HTML by hand to get it how you want it to look.  From there it should be
fairly routine to generate that format from input XML.

Regards,

--A

>From: "Martie Kruger" <MartinaKr@xxxxxxxxxxxxxxx>
>Reply-To: xsl-list@xxxxxxxxxxxxxxxxxxxxxx
>To: "Xsl-List-Help" <xsl-list@xxxxxxxxxxxxxxxxxxxxxx>
>Subject:  FW:  xsl code to create tables of different number columns
>and rows
>Date: Thu, 19 May 2005 10:07:47 +0200
>
>Hi
>I am using Windows XP; Stylus Studio to create a style sheet to display
>documents as HTML. The schema I use is a given - I cannot change it.
>My problem: How do I create a style for tables that is not the same amount
>of columns & rows. The code from the xml file will probably explain better:
>
><table>
><tgroup cols="2"><colspec colname="col1"/><colspec colname="col2"/>
><tbody>
><row>
><entry>column1rowa</entry>
><entry>column2rowa</entry>
><entry>column3rowa</entry>
></row>
><row>
><entry>column1rowb</entry>
><entry>column2rowb</entry>
><entry>column3rowb</entry>
></row>
></tbody>
></tgroup>
></table>
><table>
><tgroup cols="3"><colspec colname="col1"/><colspec colname="col2"/><colspec
>colname="col3"/>
><tbody>
><row>
><entry>column1rowa</entry>
><entry>column2rowa</entry>
></row>
><row>
><entry>column1rowb</entry>
><entry>column2rowb</entry>
></row>
><row>
><entry>column1rowc</entry>
><entry>column2rowc</entry>
></row>
></tbody>
></tgroup>
></table>
>
>I do not have the faintest idea how to get a style sheet that can produce
>tables from this code. Can anyone help please.
>
>
>Martie Kr|ger
>+27 12 620 3165
>082 571 3656
**********************************************************************
This email and any files transmitted with it are confidential and
intended solely for the use of the individual or entity to whom they
are addressed. If you have received this email in error please notify
the system manager at postmaster@xxxxxxxxxxxxxxxx
**********************************************************************

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.