RE: [xsl] Re: <xsl:choose> or variable syntax incorrect?

Subject: RE: [xsl] Re: <xsl:choose> or variable syntax incorrect?
From: "Passin, Tom" <tpassin@xxxxxxxxxxxx>
Date: Fri, 26 Sep 2003 15:19:55 -0400
[ Kathy Burke]

> First, I truly appreciate your responding. But please tell me 
> how I did not
> "explain the problem I've solving"? I honestly thought I did!

Kathy, stop making this so hard!  You are trying to transform some input
into some output.  You have not really told us accurately and concisely
what the output should be, and you have not told us what you get when
you say that "it doesn't work".  For example, the bgcolor attribute
belongs on the td, not the tr. That is an HTML problem.  You need to get
your HTML right, then think about the transform. One of your posts
contained non-wellformed xml in a template.  That is an xml problem.
You need to say how you know it isn't working, like the error message or
the actual results.

Think simple.  Based on what you have said - and I know that ultimately
you want to do something more complex - here is a simple solution that
works in the sense that it creates either a red or a blue background
cell filled with the station name, depending on the presence of
boards/board elements.  It ought to be self-explanatory.

<xsl:template match='data'>
      <xsl:apply-templates select='station'/>

<xsl:template match="station">
   <xsl:variable name='rowcolor'>
         <xsl:when test='boards/board'>red</xsl:when>
      <td bgcolor='{$rowcolor}'><xsl:value-of select='@name'/></td>



Tom P

 XSL-List info and archive:

Current Thread