You are not logged in.

1

Wednesday, December 10th 2003, 5:34pm

kopete style help

anyone know how to write a kopete style to look like this:

[12/10/03 12:24:35pm] clockworks: hello
[12/10/03 12:24:40pm] mybuddy: hello back, friend

thanks!

2

Wednesday, December 10th 2003, 9:09pm

Where are the styles documented? I couldnt figure out how to produce a date. Here is as close as i could get:

[code:1]
<?xml version = '1.0' encoding = 'UTF-8'?>
<xsl&#58;stylesheet xmlns&#58;xsl="http&#58;//www.w3.org/1999/XSL/Transform" version="1.0" >
<xsl&#58;output xmlns&#58;xsl="http&#58;//www.w3.org/1999/XSL/Transform" method="html" />
<xsl&#58;template xmlns&#58;xsl="http&#58;//www.w3.org/1999/XSL/Transform" match="message" >
<div class="KopeteMessage" >
<xsl&#58;attribute xmlns&#58;xsl="http&#58;//www.w3.org/1999/XSL/Transform" name="id" >
<xsl&#58;value-of xmlns&#58;xsl="http&#58;//www.w3.org/1999/XSL/Transform" select="@id" />
</xsl&#58;attribute>
<xsl&#58;attribute xmlns&#58;xsl="http&#58;//www.w3.org/1999/XSL/Transform" name="style" >
<xsl&#58;if xmlns&#58;xsl="http&#58;//www.w3.org/1999/XSL/Transform" test="body/@color" >
<xsl&#58;text xmlns&#58;xsl="http&#58;//www.w3.org/1999/XSL/Transform">color&#58;</xsl&#58;text>
<xsl&#58;value-of xmlns&#58;xsl="http&#58;//www.w3.org/1999/XSL/Transform" select="body/@color" />
<xsl&#58;text xmlns&#58;xsl="http&#58;//www.w3.org/1999/XSL/Transform">;</xsl&#58;text>
</xsl&#58;if>
<xsl&#58;if xmlns&#58;xsl="http&#58;//www.w3.org/1999/XSL/Transform" test="body/@bgcolor" >
<xsl&#58;text xmlns&#58;xsl="http&#58;//www.w3.org/1999/XSL/Transform">background-color&#58;</xsl&#58;text>
<xsl&#58;value-of xmlns&#58;xsl="http&#58;//www.w3.org/1999/XSL/Transform" select="body/@bgcolor" />
</xsl&#58;if>
</xsl&#58;attribute>
<xsl&#58;if xmlns&#58;xsl="http&#58;//www.w3.org/1999/XSL/Transform" test="@direction='3'" >
<xsl&#58;attribute xmlns&#58;xsl="http&#58;//www.w3.org/1999/XSL/Transform" name="style" >
<xsl&#58;text xmlns&#58;xsl="http&#58;//www.w3.org/1999/XSL/Transform">color&#58;darkgreen</xsl&#58;text>
</xsl&#58;attribute>
</xsl&#58;if>
&#91;<xsl&#58;value-of xmlns&#58;xsl="http&#58;//www.w3.org/1999/XSL/Transform" select="@date" /> <xsl&#58;value-of xmlns&#58;xsl="http&#58;//www.w3.org/1999/XSL/Transform" select="@time" />&#93;
<!-- Choose based on message direction --><xsl&#58;choose xmlns&#58;xsl="http&#58;//www.w3.org/1999/XSL/Transform">
<xsl&#58;when xmlns&#58;xsl="http&#58;//www.w3.org/1999/XSL/Transform" test="@direction='2'" >
<!--internal message--><font color="green" >---</font>
</xsl&#58;when>
<xsl&#58;when xmlns&#58;xsl="http&#58;//www.w3.org/1999/XSL/Transform" test="@direction='3'" >
<!--action message--><span class="KopeteDisplayName" >
<xsl&#58;value-of xmlns&#58;xsl="http&#58;//www.w3.org/1999/XSL/Transform" select="from/contact/@metaContactDisplayName" disable-output-escaping="yes" />
</span>
<xsl&#58;text xmlns&#58;xsl="http&#58;//www.w3.org/1999/XSL/Transform" disable-output-escaping="yes" />
</xsl&#58;when>
<xsl&#58;otherwise xmlns&#58;xsl="http&#58;//www.w3.org/1999/XSL/Transform">
<font>
<xsl&#58;attribute xmlns&#58;xsl="http&#58;//www.w3.org/1999/XSL/Transform" name="color" >
<xsl&#58;choose xmlns&#58;xsl="http&#58;//www.w3.org/1999/XSL/Transform">
<xsl&#58;when xmlns&#58;xsl="http&#58;//www.w3.org/1999/XSL/Transform" test="@direction='1'" >
<!-- Outgoing --><xsl&#58;text xmlns&#58;xsl="http&#58;//www.w3.org/1999/XSL/Transform">red</xsl&#58;text>
</xsl&#58;when>
<xsl&#58;otherwise xmlns&#58;xsl="http&#58;//www.w3.org/1999/XSL/Transform">
<!-- Incoming --><xsl&#58;text xmlns&#58;xsl="http&#58;//www.w3.org/1999/XSL/Transform">blue</xsl&#58;text>
</xsl&#58;otherwise>
</xsl&#58;choose>
</xsl&#58;attribute>
<span class="KopeteDisplayName" >
<xsl&#58;value-of xmlns&#58;xsl="http&#58;//www.w3.org/1999/XSL/Transform" select="from/contact/@metaContactDisplayName" disable-output-escaping="yes" />
</span>
</font>
<font color="blue" >&#58; </font>
</xsl&#58;otherwise>
</xsl&#58;choose>
<span>
<xsl&#58;if xmlns&#58;xsl="http&#58;//www.w3.org/1999/XSL/Transform" test="@importance='2'" >
<xsl&#58;attribute xmlns&#58;xsl="http&#58;//www.w3.org/1999/XSL/Transform" name="class" >
<xsl&#58;text xmlns&#58;xsl="http&#58;//www.w3.org/1999/XSL/Transform">KopeteMessage highlight</xsl&#58;text>
</xsl&#58;attribute>
</xsl&#58;if>
<xsl&#58;value-of xmlns&#58;xsl="http&#58;//www.w3.org/1999/XSL/Transform" select="body" disable-output-escaping="yes" />
</span>
</div>
</xsl&#58;template>
</xsl&#58;stylesheet>
[/code:1]

3

Wednesday, December 10th 2003, 9:14pm

wow, uhh...thanks...pretty complicated looking for something seemingly simple. whats a good book to get to learn xml? or a good online reference for a beginner. i'm a c/c++ programmer with experience in java, perl, and a few other langs also, but i'm always looking to expand my horizon and i think xml would be something good to pick up...

thanks.