Different color within the same node
-
I'm completelly new to XML/XSL so bare with me. I'm trying to use different colors within the same node... In the following example: __________________________________________________ <?xml version="1.0" encoding="utf-8" standalone="yes"?> <example> <title> This is the title </title> <text> This is a sample text. I want to make next word <g>GREEN<g> I want to make this one <r>RED<r> </text> </example> _____________________________________________________________ What should style.xsl be so that the word "GREEN" appears green and same with "RED" once I open it with the browser? Is there an easier way to code the XML in order to achieve that? Thanks!
-
I'm completelly new to XML/XSL so bare with me. I'm trying to use different colors within the same node... In the following example: __________________________________________________ <?xml version="1.0" encoding="utf-8" standalone="yes"?> <example> <title> This is the title </title> <text> This is a sample text. I want to make next word <g>GREEN<g> I want to make this one <r>RED<r> </text> </example> _____________________________________________________________ What should style.xsl be so that the word "GREEN" appears green and same with "RED" once I open it with the browser? Is there an easier way to code the XML in order to achieve that? Thanks!
Ok... I found the answer to my own question(below), but can I achieve the same result some other way, so I don't have to create nodes for it? It is very time consuming to edit the text in that manner... Thanks again! ________________________________ <?xml version='1.0'?> <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0"> <xsl:template match="r"> <font color="red">xsl:apply-templates/</font> </xsl:template> <xsl:template match="g"> <font color="green">xsl:apply-templates/</font> </xsl:template> </xsl:stylesheet> ____________________________________