[Home] [By Thread] [By Date] [Recent Entries]

  • From: Richard Watt <richard@f...>
  • To: xml-dev@l...
  • Date: Fri, 25 Feb 2022 21:35:52 +0000

Hello,

I was hoping I could get some advice on formatting a HTML table row from an XSL style sheet in Google Chrome running on Windows 10 - I can get the exact versions if needed and I'm running a SQL query on a database to get a list of orders for a customer with a CSS style sheet with a set of styles defined for the table rows according to the possible status values for an order:

  • Completed: trCompleted = { color: green; }
    
  • Rejected: trRejected = { filter: alpha(opacity=50); }
    
  • Cancelled: trCancelled = { color: red; }
    
  • In Progress: trInProgress = { color: orange; }
    

I'm displaying the data in the following columns in the table:

  • Order Number
  • Customer Name
  • Account Number
  • Description
  • Net Value
  • Sales Tax
  • Gross Value
  • Order Status

I want to format the rows so that their values are formatted with the appropriate CSS style class for the order status: what I've got at the moment is something along these lines after a <TR> tag (I've just listed the line for a row displaying a completed order and split up the formatting to make it more readable):

<xsl:if test="ORDERSTATUS='Completed'">
  <xsl:attribute-value name="class">trCompleted</xsl:attribute>
</xsl:if>

This seems to be ignored by Chrome and  the order data is displayed in a regular black font.

I've tried a few different ways of correcting this, including using a <xsl:choose> tag with a <xsl:when> for each case and a _javascript_ function to determine the style name from the order status, but none of these appear to have worked and
I was wondering what I'm doing wrong?

Best regards,

--
   Richard Watt
   Website: http://www.familywatt.co.uk/
  
  
  



[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index]


Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member