Re: [xsl] two column table with alternating row colors using xsl xml and css

Subject: Re: [xsl] two column table with alternating row colors using xsl xml and css
From: nicholse@xxxxxxxxxxxxxxxx
Date: Sat, 9 Aug 2003 00:47:35 -0700 (PDT)
The most progress yet. Still some problems.
I cant get the following-sibling to display individual elements only the *
works. I suspect my understanding of xpath is the problem. I want the
second two columns to format like the first two. Also if there is no data
for phone number I want to prevent the () from displaying. For this I
tried when test phone-number but this still outputs the (). Why?
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0"
<xsl:output method="html" version="1.0" encoding="UTF-8" indent="yes" />
<xsl:template match="fmp:FMPDSORESULT">
<!-- this is just an example, you can change this to whatever you like -->
.r0 { background-color: silver; color: black; width: 50%;}
.r1 { color: gray; width: 50%;}
  <xsl:for-each select="fmp:ROW[position() &lt;= ceiling(count(../fmp:ROW)
div 2)]">
   <xsl:sort select="fmp:Co" />
    <TR class="r{position() mod 2}">
      <TD class="r{position() mod 2}">
	<B><xsl:value-of select="fmp:Co" /></B><BR />
	<xsl:value-of select="fmp:Address1" /><BR />
	<xsl:value-of select="fmp:City1" />, <xsl:value-of select="fmp:State1" />
<xsl:value-of select="fmp:Zip1" />
	<BR />
          <xsl:when test="fmp:Phone1_Number">
            <TD class="r{position() mod 2}">
              (<xsl:value-of select="fmp:Phone1_Area_Code" />)
              <xsl:value-of select="fmp:Phone1_Number" />
              <BR />
            <TD class="r{position() mod 2}"></TD>
      <TD class="r{position() mod 2}">
          <xsl:when test="following-sibling::fmp:ROW">
select="following-sibling::*[ceiling(count(../fmp:ROW) div
      <TD class="r{position() mod 2}">

 XSL-List info and archive:

Current Thread