[Date Prev]
| [Thread Prev]
| [Thread Next]
| [Date Next]
--
[Date Index]
| [Thread Index]
Re: [xml-dev] Conditionally formatting a HTML table row usingXML/XSL
- From: "Liam R. E. Quin" <liam@fromoldbooks.org>
- To: Richard Watt <richard@familywatt.co.uk>, xml-dev@lists.xml.org
- Date: Sun, 27 Feb 2022 13:06:17 -0500
On Sun, 2022-02-27 at 12:38 +0000, Richard Watt wrote:
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>
Try,
<tr>
<xsl:if test="ORDERSTATUS = 'Completed'}>
<xsl:attribute name="class">trCompleted</xsl:attribute>
</xsl:if>
</tr>
(you can use either tr or TR if this is HTML; the element names are "ASCII Case-Insensitive")
Then look out the output HTML to see if the class attribute is being generated.
The XSLT here says, if there's a subelement of the node being processed which has the string value "Completed" (case-sensitive, so not COMPLETED or completed), then we want to add the attribute.
Liam
--
Available for XML/Document/Information Architecture/XSLT/
XSL/XQuery/Web/Text Processing/A11Y training, work & consulting.
[Date Prev]
| [Thread Prev]
| [Thread Next]
| [Date Next]
--
[Date Index]
| [Thread Index]