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
Abbas AhmadSubject: Coloring xml output
Author: Abbas Ahmad
Date: 17 Jun 2008 01:51 AM
Hi,

As a new to xslt and xml i have difficulties on this topic

I have an xml data is like this

<Group>
<Sub>
<Sub_color>#333333</Sub_color>
<Sub_name>Andi</Sub_name>
</Sub>
<Sub>
<Sub_color>#666666</Sub_color>
<Sub_name>Yohana</Sub_name>
</sub>
<Sub>
<Sub_color>n....color</Sub_color>
<Sub_name>n....name</Sub_name>
</sub>
</Group>

For the output of Sub_name will be coloured with Sub_color value, so every name should have different color accourding the Sub_color value, anyone could help me with this task, please? is it posible in xslt?

Postnext
Tadd StuartSubject: Coloring xml output
Author: Tadd Stuart
Date: 24 Jun 2008 10:26 AM
Here is one option

<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:template match="Group">
<table>
<xsl:for-each select="Sub">
<xsl:variable name="color" select="Sub_color"/>
<tr>
<td bgcolor="{$color}">
<xsl:value-of select="Sub_name"/>
</td>
</tr>
</xsl:for-each>
</table>
</xsl:template>
</xsl:stylesheet>

Posttop
Abbas AhmadSubject: Coloring xml output
Author: Abbas Ahmad
Date: 25 Jun 2008 03:05 AM
That's awesome, i never thing about that
thanks a lot, you broadent my mind

another question

xml is a raw data as it is, but what if we want to make another action from it, your answer make me wondering like this

1. what if i want to make the xml data is a link to url address, like when we click it, it redirect us to a specific url

2. another thing is, some time i saw in most of the website, when we point the word it can showing a message ballon with some data in it, does xsl is able to do that?

3. What is that xsl able and not be able to do? do you know where can i get those information, or maybe you know about it? please share to me

i'm getting excited with this xml and xsl thing

Regards

 
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.