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

Re: need a hint on matching table cells

Subject: Re: need a hint on matching table cells
From: "Charles Knell" <cknell@xxxxxxxxxx>
Date: Wed, 17 Jul 2002 13:04:07 -0700
td hint
Maybe you could post the "CELL" template?

-- 
Charles Knell
cknell@xxxxxxxxxx - email


---- "Brad Miller" <Brad.Miller@xxxxxxxxxxx> wrote:
> I wanted to try to figure this out on my own but I think I am at the
> point where I need a little hint to help me along.
> 
> I need to create an HTML table structure that has 3 columns. In my
> XML I have something like this:
> <T-BODY>
> <ROW>
> 	<CELL SPAN="grey">grey equals a colspan of 2 and td shaded
> in gray.</CELL>
> 	<CELL SPAN="normal">some text normal td tag</CELL>
> </ROW>
> <ROW>
> 	<CELL SPAN="normal">some text normal td tag</CELL>
> 	<CELL SPAN="normal">some text normal td tag</CELL>
> 	<CELL SPAN="normal">some text normal td tag</CELL>
> </ROW>
> <ROW>
> 	<CELL SPAN="lightgrey">lightgrey equals a colspan of 2 and
> td shaded in lightgray.</CELL>
> 	<CELL SPAN="normal">some text normal td tag</CELL>
> </ROW>
> </T-BODY>
> 
> I am currently testing for the SPAN attribute and then applying the
> appropriate template.(or so I thought)
> 
> <xsl:template match="T-BODY/ROW">
> 	<tr>
> 		<xsl:if test="CELL/@SPAN = 'grey'">
>    			<td colspan="2" class="grey"><xsl:apply-templates
>  select = "CELL" /></td>
>    		</xsl:if>
>    		<xsl:if test="CELL/@SPAN = 'lightgrey'">
>    			<td colspan="2" class="lightgrey"><xsl:apply-templates
>  select = "CELL" /></td>
>    		</xsl:if>
>    		<xsl:if test="CELL/@SPAN = 'normal'">
>    			<td><xsl:apply-templates  select = "CELL"
> /></td>
>    		</xsl:if>
> 	</tr>
> </xsl:template>
> 
> This is what I get as an end result:
> <tr>
> <td class="grey" colspan="2">grey equals a colspan of 2 and td shaded
> in gray.some text normal td tag</td>
> <td>grey equals a colspan of 2 and td shaded in gray.some text normal
> td tag</td>
> </tr>
> <tr>
> <td>some text normal td tagsome text normal td tagsome text normal
> td tag</td>
> </tr>
> <tr>
> <td class="lightgrey" colspan="2">lightgrey equals a colspan of 2 and
> td shaded in lightgray.some text normal td tag</td>
> <td>lightgrey equals a colspan of 2 and td shaded in lightgray.some
> text normal td tag</td>
> </tr>
> 
> As you can see it is taking all the CELL information and dumping it
> into each td when the SPAN attribute is different and only creating
> one td for the sections where the SPAN attribute is the same.
> 
> I think I understand why it is doing this but I am not sure how to
> go about changing it to work correctly.
> 
> Thanks for any help you have to offer
> Brad
> 
>  XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
> 
>  

 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.