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

How do I skip an element?

Subject: How do I skip an element?
From: "Larry Mason" <Larry_Mason@xxxxxx>
Date: Tue, 4 May 1999 16:30:48 -0500
larry mason

Hi all !
I am trying to produce a table where the column headings are the element names
except for one particular name that is to be excluded.  What is giving me fits
is the exclusion.  I tried several approaches, all of which fail.  Any insight
would be appreciated.  I am using XT for the transformation.
Thanks,
Larry Mason
i2 Technologies

XML
<data>
<row><column1>text1a</column1><column2>text1b</column2><column3>text3a</column3></row>
<row><column1>text2a</column1><column2>text2b</column2><column3>text3b</column3></row>
</data>

I want
<table>
<tr>
<th>column1</th>
<th>column3</th>
</tr>
<tr>
<td>text1a</td>
<td>text1c</td>
</tr>
<tr>
<td>text2a</td>
<td>text2c</td>
</tr>
</table>

Here are some things I've tried to get the TH to work but are returning 'invalid
token' or 'unexpected token' errors.
I don't know what the column names will be except there is one column that is
always present which I want to exclude.

<xsl:for-each select="data/*[first-of-any()]/*[name(.) !='column2']">
   <TH><xsl:value-of select="name(.)"/></TH>
</xsl:for-each>

<xsl:for-each select="data/*[first-of-any()]/* $and$ data/*/*[name(.)
!='column2']">
   <TH><xsl:value-of select="name(.)"/></TH>
</xsl:for-each>



 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.