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

RE: First close a tag, then open

Subject: RE: First close a tag, then open
From: "Martinez, Brian" <brian.martinez@xxxxxxxxxxx>
Date: Wed, 3 Dec 2003 09:34:42 -0700
xml tag open close check
Forgive me--somehow I hit Ctrl+S while typing my reply.  Ignore my previous
response.

> From: Patrick van Halderen [mailto:patrick@xxxxxxxxxxxxxxxxxxx]
> Sent: Wednesday, December 03, 2003 8:53 AM
> Subject:  First close a tag, then open
> 
> 
> Hi all,
> 
> I'm currently facing the following problem:
> 
> I need to format some data in a list into an HTML table. However, I 
> need 2 columns, so I thought of using a <xsl:if 
> test="position() mod 2 
> = 0"> after each item. However, when making things up, I 
> ended with the 
> following code, which doesn't validate, for closing the tr first, and 
> opening it there after. Check this:

On the list of Top Ten XSLT FAQs, this is Number 0.  With a bullet.  ;-)

Anyway: you're thinking in terms of tags, not nodes.  XSLT, as an XML-based
language, doesn't do tags.  It builds result trees from source trees.  This
requires well-formed XML, in both the source and your stylesheet:

> <xsl:if test="position() mod 2 = 0">
> 
> 	</tr>
> 	<tr>
> 
> </xsl:if>

. . . which this isn't.

There are several approaches to building multi-column tables from XML;
rather than reinvent the wheel, just check out the XSLT FAQ:
http://www.dpawson.co.uk/xsl/sect2/N7450.html

hth,
b.

| brian martinez                           brian.martinez@xxxxxxxxxxx |
| lead gui programmer                                    303.357.3548 |
| cheap tickets, part of trip network                fax 303.357.3380 |
| 6560 greenwood plaza blvd., suite 400           englewood, co 80111 |
| cendant travel distribution services   http://www.cheaptickets.com/ |

 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.