What happened to the Messenger Plus! forums on msghelp.net?
Shoutbox » MsgHelp Archive » Messenger Plus! for Live Messenger » WLM Plus! Help » Convert Windows Live Messenger XML ChatLogs to Messenger Plus! Live HTML ChatLogs

Convert Windows Live Messenger XML ChatLogs to Messenger Plus! Live HTML ChatLogs
Author: Message:
XP1
Junior Member
**

Avatar

Posts: 28
Joined: Nov 2004
O.P. RE: Convert Windows Live Messenger XML ChatLogs to Messenger Plus! Live HTML ChatLogs
I copied and pasted sections of the HTML logs generated by Messenger Plus! Live into the XSL file generated by Windows Live Messenger. I was able to come up with a somewhat successful conversion, but there is a problem I don't understand yet.

Under the xml:for-each, I have to generate separate <table cellspacing="0"> and <tbody> tags. This causes the chat log text to be misaligned differently among each chat line.

This is my first time dealing with XSL / XML code. Can someone look into this issue to get it solved? Thanks.

I've attached the ZIP file containing the XSL file and a PNG screenshot.

If you cannot open ZIP files, copy and paste the following code below into an empty TXT file and rename it to MessageLog.xsl.



MessageLog.xsl:
code:
<?xml version="1.0"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
  <xsl:template match="Log">
    <html>
    <head>
    <title>Messenger Plus! Chat Log</title>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-16"/>
    <style type="text/css">
body {
    background-color: white;
    padding:0;
    margin:10px 10px 20px 10px;
    color:black;
    font-size: 0.8em;
    font-family: "MS Shell Dlg", sans-serif;
}
img {
    vertical-align: text-bottom;
}
h1, h2 {
    font-family: "Segoe UI", Tahoma, Verdana, sans-serif;
    margin:0;
    padding:0;
}
h1 {
    color:#3aba07;
    letter-spacing:-1px;
    font-weight:normal;
    font-size: 1.8em;
    margin:0;
    padding:0;
}
h2 {
    color:#1987cc;
    font-size: 1.2em;
    margin:10px 0 2px 0;
    padding:3px 0;
    border-top:1px solid #dcf7fd;
}
.mplsession {
    padding: 0 0 20px 0;
}
.mplsession img {
    vertical-align:top;
}
.mplsession img.bigimg {
    vertical-align:text-bottom;
}
.mplsession ul {
    list-style-type:none;
    margin:0;
    padding:0;
    border-top: 1px solid #6ed6f3;
    border-bottom:4px solid #f7feef;
    font-family: "Segoe UI", Tahoma, Verdana, sans-serif;
    font-size:0.95em;
    color:#333333;
}
.mplsession ul li {
    padding:0 7px 2px 7px;
    background:#dcf7fd;
    border-top:2px solid #edfbfe;
    border-bottom:1px solid #6ed6f3;
}
.mplsession ul li.in {
    background:#edfbfe;
    border-top:2px solid #fff;
}
.mplsession table {
    font-size: 1em;
    margin:5px 0 10px 0;
    padding:0;
    width:100%;
}
.mplsession table th {
    text-align:left;
    font-weight:bold;
    padding:1px 2px 3px 6px;
    padding-right:1em;
    vertical-align:top;
    white-space:nowrap;
}
.mplsession table th span.time {
    color:#949494;
    font-weight:normal;
}
.mplsession table td {
    padding:1px 2px;
    width:100%;
    vertical-align:top;
}
.mplsession table tr {
    color:black;
}
.mplsession table tr.messenger td, .mplsession table tr.messenger th {
    background:#ffffe6;
    padding-top:2px;
    padding-bottom:2px;
    border:1px solid #e9e9e9;
}
.mplsession table tr.messenger td {
    border-left:0;
}
.mplsession table tr.messenger th {
    border-right:0;
    padding-left:5px;
}
.mplsession table tr.msgplus td, .mplsession table tr.msgplus th {
    background:#ffffe6;
    padding-top:2px;
    padding-bottom:2px;
    border:1px dashed #e9e9e9;
}
.mplsession table tr.msgplus td {
    border-left:0;
}
.mplsession table tr.msgplus th {
    border-right:0;
    padding-left:5px;
}
@media print {
.mplsession table {
    width:97%;
}
}
</style>
    <!-- If you want to customize the style used in this file, create a "custom.css" file -->
    </head>
    <body>
    <h1>Messenger Plus! Chat Log</h1>
    <div class="mplsession">
      <!--This for-each creates the lines needed for clickable links to Session logs-->
      <xsl:for-each select="Message">
        <!--This if checks the first Message of each SessionID-->
        <xsl:if test="not(preceding-sibling::Message[1]/@SessionID = @SessionID)">
          <xsl:choose>
            <xsl:when test="not(preceding-sibling::Message[1]/@SessionID = @SessionID)">
              <a href="#{@DateTime}"> <xsl:value-of select="@Date" /><xsl:text> </xsl:text><xsl:value-of select="@Time" /> </a> <xsl:text> </xsl:text>(<xsl:value-of select="Text" />)<br/>
            </xsl:when>
          </xsl:choose>
        </xsl:if>
      </xsl:for-each>
      <xsl:for-each select="Message">
        <xsl:choose>
          <xsl:when test="not(preceding-sibling::Message[1]/@SessionID = @SessionID)">
            <h2><a name="{@DateTime}"> </a> Session Start: <xsl:value-of select="@Date" /></h2>
            <ul>
              <xsl:for-each select="From/User">
                <li class="in"> <xsl:value-of select="@FriendlyName" /></li>
              </xsl:for-each>
              <xsl:for-each select="To/User">
                <li> <xsl:value-of select="@FriendlyName" /></li>
              </xsl:for-each>
            </ul>
          </xsl:when>
        </xsl:choose>
        <table cellspacing="0">
          <tbody>
          <xsl:comment>
            (<xsl:value-of select="@Time" />)
          </xsl:comment>
          <tr>
            <th><span class="time">(<xsl:value-of select="substring(@Time, 1, 4)" /> <xsl:text> </xsl:text> <xsl:value-of select="substring(@Time, 9, 10)" />)</span> <xsl:text> </xsl:text> <xsl:value-of select="substring(From/User/@FriendlyName, 1, 17)" />:</th>
            <td style="{Text/@Style}"><xsl:value-of select="Text" /></td>
          </tr>
          </tbody>
         
        </table>
      </xsl:for-each>
    </div>
    </body>
    </html>
  </xsl:template>
</xsl:stylesheet>

.zip File Attachment: XML to HTML MessageLog.zip (64.53 KB)
This file has been downloaded 1262 time(s).

This post was edited on 06-02-2008 at 04:36 AM by XP1.
06-02-2008 04:34 AM
Profile E-Mail PM Web Find Quote Report
« Next Oldest Return to Top Next Newest »

Messages In This Thread
Convert Windows Live Messenger XML ChatLogs to Messenger Plus! Live HTML ChatLogs - by XP1 on 06-01-2008 at 02:24 PM
RE: Convert Windows Live Messenger XML ChatLogs to Messenger Plus! Live HTML ChatLogs - by XP1 on 06-02-2008 at 04:34 AM
RE: Convert Windows Live Messenger XML ChatLogs to Messenger Plus! Live HTML ChatLogs - by Ruki on 09-07-2009 at 05:49 PM
RE: RE: Convert Windows Live Messenger XML ChatLogs to Messenger Plus! Live HTML ChatLogs - by XP1 on 09-07-2009 at 06:09 PM


Threaded Mode | Linear Mode
View a Printable Version
Send this Thread to a Friend
Subscribe | Add to Favorites
Rate This Thread:

Forum Jump:

Forum Rules:
You cannot post new threads
You cannot post replies
You cannot post attachments
You can edit your posts
HTML is Off
myCode is On
Smilies are On
[img] Code is On