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
Show tree view Topic
Topic Page 1 2 3 4 5 6 7 8 9 Go to previous topicPrev TopicGo to next topicNext 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

 
Topic Page 1 2 3 4 5 6 7 8 9 Go to previous topicPrev TopicGo to next topicNext Topic
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.