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

Maximum columns in a table

Subject: Maximum columns in a table
From: "Mattias Pirmann" <Mattias.Pirmann@xxxxxxxxx>
Date: 6 Apr 2006 13:01:17 +0200
maximum columns in a table
Hi!

I m very new to XSLT and have only worked with simple tables. Now I have
problem I hope someone can help me with.

I have two different kinds of attributes, cart and unit, which should be
presented in two tables depending on if the element only holds cart or cart
and unit.

The table that only holds attribute cart should present the values in a table
of 5 columns. If it has more than 5 values it should create a new row i.e. 50
values should be presented in a table of 10 rows with 5 columns.

The table that holds both cart and units should be presented in a table of 5
columns. The first column should hold cart and column 2-5 unit. If more than 4
units exist it should be put on row 2 starting in column 2.

Should I create two elements, one that only holds cart and one that holds cart
with units or stick with one? How can I make the maximum number of columns and
also specify on which column to start on in the next row.


Below is the three conditions

Only carts - 5 columns in each row

2174123434567  2174123445677 2174123434567 2174123434567  2174123434567
2174123434567  2174123434567 2174123434567 2174123434567  2174123434567

If cart and unit exist

2174123434567 sczu111222-6  xscu222333-5 scxu333444-5 xcsu444333-5

If more than 4 units per cart

2174123434567 sczu111222-6  xscu222333-5 scxu333444-5 xcsu444333-5
              xscu222333-5  scxu333444-5 xcsu444333-5 sczu111222-6
2174123434567 sczu111222-6  xscu222333-5 scxu333444-5 xcsu444333-5
              sczu111222-6  xscu222333-5 scxu333444-5 xcsu444333-5


XML code

1 element - cartinfo

<?xml version="1.0" encoding="ISO-8859-1"?>

<general>
 <cartinfo>
  <cart>1174123434567</cart>
 </cartinfo>
 ........
 <cartinfo>
  <cart>1174123434567</cart>
  <unit>xscu222333-5</unit>
  <unit>xscu222333-5</unit>
  <unit>xscu222333-5</unit>
  <unit>xscu222333-5</unit>
 </cartinfo>
 ........
</general>

2 elements - cartinfo and cartunitinfo

<?xml version="1.0" encoding="ISO-8859-1"?>

<general>
 <cartinfo>
  <cart>1174123434567</cart>
 </cartinfo>
 ..........
 <cartunitinfo>
  <cart>1174123434567</cart>
  <unit>xscu222333-5</unit>
  <unit>xscu222333-5</unit>
  <unit>xscu222333-5</unit>
  <unit>xscu222333-5</unit>
 </cartunitinfo>
 ............
</general>


Regards

Mattias

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.