[Adium-devl] [Adium-feedback] Saved Log Files
Andreas Monitzer
soc at monitzer.com
Wed Feb 14 06:41:43 UTC 2007
Hi,
I finished the xslt. It seems like the browsers don't care about the
incorrect namespace (since they aren't using an XML parser anyways).
The formatting is very simple, it's just a demonstration of what's
possible.
I've appended it at the bottom.
andy
-------
<?xml version='1.0' encoding='utf-8'?>
<xsl:stylesheet version='1.0' xmlns:xsl='http://www.w3.org/1999/XSL/
Transform'
xmlns:ulf='http://purl.org/net/ulf/ns/
0.4-02'
xmlns='http://www.w3.org/1999/xhtml'>
<xsl:output method='xml' version='1.0' encoding='utf-8' indent='no'/>
<xsl:template match="/">
<xsl:text disable-output-escaping="yes">
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
</xsl:text>
<html>
<head>
<title>Log of <xsl:value-of select="/ulf:chat/@account"/> on
<xsl:value-of select="/ulf:chat/@service"/></title>
<style type="text/css" title="text/css">
<xsl:text disable-output-escaping="yes">
ul {
list-style-type: none;
}
.status {
font-size: 80%;
font-style: italic;
color: orange;
}
.type:before {
content: "<";
}
.type:after {
content: ">";
}
.time:before {
content: "[";
}
.time:after {
content: "]";
}
.sender {
font-weight: bold;
}
.event_windowOpened {
color: green;
}
.event_windowOpened > .sender {
display: none;
}
.event_windowOpened:after {
content: "Window opened";
padding-left: 1em;
}
.event_windowClosed {
color: red;
}
.event_windowClosed > .sender {
display: none;
}
.event_windowClosed:after {
padding-left: 1em;
content: "Window closed";
}
.content {
padding-left: 1em;
}
</xsl:text>
</style>
</head>
<body>
<ul>
<xsl:apply-templates select="/ulf:chat/ulf:event|/ulf:chat/
ulf:message|/ulf:chat/ulf:status"/>
</ul>
</body>
</html>
</xsl:template>
<xsl:template match="/ulf:chat/ulf:event">
<li>
<span>
<xsl:attribute name="class">event_<xsl:value-of select="@type"/></
xsl:attribute>
<span class="sender"><xsl:value-of select="@sender"/></span>
<span class="time"><xsl:value-of select="@time"/></span>
</span>
</li>
</xsl:template>
<xsl:template match="/ulf:chat/ulf:message">
<li>
<span class="message">
<span class="sender"><xsl:value-of select="@sender"/></span>
<span class="time"><xsl:value-of select="@time"/></span>
<span class="content"><xsl:copy-of select="./*"/></span>
</span>
</li>
</xsl:template>
<xsl:template match="/ulf:chat/ulf:status">
<li>
<span class="status">
<span class="type"><xsl:value-of select="@type"/></span>
<span class="sender"><xsl:value-of select="@sender"/></span>
<span class="time"><xsl:value-of select="@time"/></span>
<span class="content"><xsl:copy-of select="./*"/></span>
</span>
</li>
</xsl:template>
</xsl:stylesheet>
More information about the devel
mailing list