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

Data into 3 even columns

  • From: "Jesse Mandel" <jesse.mandel@g...>
  • To: xml-dev@l...
  • Date: Wed, 4 Apr 2007 16:18:30 -0700

Data into 3 even columns
I have an XML file with make and model car data (example at the end). It has an unknown number of makes and an unknown number of models per make. I want to use an XSLT doc to format it into 3 even columns. Ideally it wouldn't break the makes up but it counts both makes and models in the total count. See the desired output below.

I am new to XML and have gotten the output to work except this part. I can get the count but I don't know how to break the data up evenly. Any ideas? Is it possible?

<data>
<make name="ford">
<model>mustang</model>
</make>
<make name="honda">
<model>civic</model>
<model>accord</model>
</make>
<make name="toyota">
<model>corolla</model>
<model>rav4</model>
<model>tundra</model>
</make>
<make name="hummer">
<model>h1</model>
<model>h2</model>
</make>
</data>

----------> to ----------->

<div style="float: left">
<ul>
<li class="make">ford</li>
<li class="model">mustang</li>
<li class="make">honda</li>
<li class="model">civic</li>
<li class="model">accord</li>
</ul>
</div>
<div style="float: left">
<ul>
<li class="make">toyota</li>
<li class="model">corolla</li>
<li class="model">rav4</li>
<li class="model">tundra</li>
</ul>
</div>
<div style="float: left">
<ul>
<li class="make">hummer</li>
<li class="model">h1</li>
<li class="model">h2</li>
</ul>
</div>

--
____________________________
jessem@c...
B.S. Computer Science
University of California Santa Barbara


[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index]


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
 

Stylus Studio has published XML-DEV in RSS and ATOM formats, enabling users to easily subcribe to the list from their preferred news reader application.


Stylus Studio Sponsored Links are added links designed to provide related and additional information to the visitors of this website. they were not included by the author in the initial post. To view the content without the Sponsor Links please click here.

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.