XML Editor
Sign up for a WebBoard account Sign Up Keyword Search Search More Options... Options
Chat Rooms Chat Help Help News News Log in to WebBoard Log in Not Logged in
Conferences Close Tree View
+ Stylus Studio Feature Requests (1192)
+ Stylus Studio Technical Forum (14621)
+ Website Feedback (249)
- XSLT Help and Discussion (7625)
-> + Use of before and after string (3) Sticky Topic
-> - How do I substitute element ty... (1)
-> + How does one add working days ... (4)
-> - Help, I have existing XLT and... (1)
-> + Need help on XSLT issue - (2)
-> + EDI to XML Conversion (7)
-> - XML To JSON Conversion using X... (1)
-> + Formatting Paragraphs to same ... (2)
-> - Grouping of records (1)
-> + Problems with xsd 1.1 (4)
-> + XML to HL7 mapping (3)
-> + XSLT 3 and Iterate (2)
-> + XSL-FO to PDF preview (3)
-> + java.lang.RuntimeException: Er... (2)
-> + Create Acroforms with Stylus X... (2)
-> + How to change XSLT parameter s... (3)
-> + how to change format of the da... (2)
-> + Search "Next 8 Results " doesn... (2)
-> - Support for Git (1)
-> + newbee (8)
-- [1-20] [21-40] [41-60] Next
+ XQuery Help and Discussion (2017)
+ Stylus Studio FAQs (159)
+ Stylus Studio Code Samples & Utilities (364)
+ Stylus Studio Announcements (113)
Topic  
Postnext
Aaron BuehnerSubject: Conditional Formatting
Author: Aaron Buehner
Date: 02 Jun 2005 03:37 PM
Hi
Im trying to apply conditional formatting to my xslt document fills a HTML with my data. My xml is similar to this.

<Entry>
<Date>06/01/2005</Date>
<Time>23:25:59.128</Time>
<Message>Broadcast packet dropped</Message>
<Source>
<Source_IP>xx.xxx.xxx</Source_IP>
<Source_Port>xx</Source_Port>
<Source_Type>WAN</Source_Type>
</Source>
<Destination>
<Destination_IP>xx.xx.xxx</Destination_IP>
<Destination_Port>xx</Destination_Port>
<Destination_Type>LAN</Destination_Type>
</Destination>
</Entry>

I want to be able to check to see if a the message contains the text dropped and then change the background color of the cell that contains the message to red.

This is the xslt I have so far.

xsl:if test="Message [contains(self::, "dropped")] then ???

Postnext
Tony LavinioSubject: Conditional Formatting
Author: Tony Lavinio
Date: 03 Jun 2005 01:00 AM
Depending on the rest of your XSL, here's how the Message cell
might be represented assuming that Entry is your context:

<td>
<xsl:if test="contains(Message, 'dropped')">
<xsl:attribute name="bgcolor">red</xsl:attribute>
</xsl:if>
<xsl:value-of select="Message"/>
</td>

Posttop
Aaron BuehnerSubject: Conditional Formatting
Author: Aaron Buehner
Date: 03 Jun 2005 06:55 PM
Thanks that did the trick

   
Download A Free Trial of Stylus Studio 6 XML Professional Edition Today! Powered by Stylus Studio, the world's leading XML IDE for XML, XSLT, XQuery, XML Schema, DTD, XPath, WSDL, XHTML, SQL/XML, and XML Mapping!  
go

Log In Options

Site Map | Privacy Policy | Terms of Use | Trademarks
Stylus Scoop XML Newsletter:
W3C Member
Stylus Studio® and DataDirect XQuery ™are from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2016 All Rights Reserved.