XML.orgXML.org
FOCUS AREAS |XML-DEV |XML.org DAILY NEWSLINK |REGISTRY |RESOURCES |ABOUT
OASIS Mailing List ArchivesView the OASIS mailing list archive below
or browse/search using MarkMail.

 


Help: OASIS Mailing Lists Help | MarkMail Help

[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index]
Re: [xml-dev] Conditionally formatting a HTML table row using XML/XSL

Hi Matthias,

My apologies - that's me remembering the tags incorrectly: it's using <xsl:attribute name="class"> </xsl:attribute>, and the actual XSL reads as:

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

Unfortunately, this doesn't work - the order details are always displayed in black regardless of the order status.

This is being used in the Google Chrome Version 98.0.4758.102 (Official Build) (64-bit) browser

Best regards,

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

On 25/02/2022 21:42, Matthias Gille Levenson wrote:

Hi,


Are you sure xsl:attribute-value is a valid XSL element ? Does xsl:attribute work ?


Best,


Matthias

On 25/02/2022 22:35, Richard Watt wrote:

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:

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

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/
  
  
  

-- 
Doctorant, ÉNS de Lyon. 
CIHAM - UMR 5648
Membre scientifique de la Casa de Velázquez


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


News | XML in Industry | Calendar | XML Registry
Marketplace | Resources | MyXML.org | Sponsors | Privacy Statement

Copyright 1993-2007 XML.org. This site is hosted by OASIS