PDA

View Full Version : Private Message Dump to HTML



killingtime
10th-October-2005, 05:46 PM
I was bored and I'm a geek. Therefore I spent a little bit of time developing an XSLT stylesheet to take a PM XML dump and render it in HTML (not in a very pretty way though). My aim was to allow it to be transformed on a browser (which excluded some of the new toys you get in XSLT 2.0 :tears: ). I'm sure you don't care about what I feel it is missing though.

Hopefully the stylesheet should be attached, as a zip file since I couldn’t upload an XML or XSLT file (along with a sample, and fictional, private message file). To use it on your own private messages there is an option to "Download All Private Messages as:" XML then you'll need to open that file in some form of text editor (like notepad :sick:) and add the line:

<?xml-stylesheet type="text/xsl" href="pm2html.xsl" ?>

just under the first line so it should look something like:

<?xml version="1.0" encoding="ISO-8859-1"?>
<?xml-stylesheet type="text/xsl" href="pm2html.xsl" ?>

(assuming you put the pm2html.xsl file in the same directory as the private message file). Then you should be able to open up your private message file in the browser and hey presto! an achieve (not a very pretty one) of your PMs. As XSLT isn't that good at text parsing then it is unlikely I'll ever add a way to see quotes highlighted in a particular way or smilies to appear.

Anyway I made it for my own use but if you do use it I'd love to know what you thought. Hope these instructions are ok and if not I can try clarifying anything. Also if people think it would be handy I can upload the XSLT onto a server somewhere.

Oh. I should mention it works under IE but looks a bit crap (since it doesn't do word wrap). Good under Firefox and I haven't had a chance to see if it works under Safari or Opera yet.

Aleks
10th-October-2005, 10:04 PM
Wooooosh!
Hope it works for all of you that understood that.

ducasi
10th-October-2005, 10:28 PM
Wooooosh!
Hope it works for all of you that understood that.
I understood it, but I've no idea if it works or not.

Sometime I'll write a perl script to turn the text output into mbox format files...

(Expecting to hear another whoosh any moment now...)

azande
10th-October-2005, 11:21 PM
It works in Safari, the only problem is that the text does not wrap.

killingtime
10th-October-2005, 11:50 PM
It works in Safari, the only problem is that the text does not wrap.

That's because white-space: pre-wrap isn't supported under Safari yet. To be fair it is a CSS 2.1 tag and none of the browsers support it as anything other than a browser extension at the moment.

I think this is a sort of wait and see bug. Good to know that Safari does XML+XSLT though :D.

DavidY
10th-October-2005, 11:51 PM
Afraid I don't understand most of that - what I did was to export to XML, then set up a mini database in Access & import it in - it doesn't do smilies or quotes, but it sounds like Killingtime's doesn't either.

I have Access 2003 - not sure if earlier versions of Access would cope with XML. I imagine there are cheaper/free database packages that could do the same thing.

killingtime
11th-October-2005, 12:03 AM
Afraid I don't understand most of that - what I did was to export to XML, then set up a mini database in Access & import it in - it doesn't do smilies or quotes, but it sounds like Killingtime's doesn't either.

It doesn't. Stupid CDATA :mad:.


I have Access 2003 - not sure if earlier versions of Access would cope with XML. I imagine there are cheaper/free database packages that could do the same thing.

Ah; truely I am among geeks :D.

azande
11th-October-2005, 12:23 AM
I imagine there are cheaper/free database packages that could do the same thing.
MySQL should be able to import CSV files but I'm not even going to try :) !

LMC
11th-October-2005, 09:26 AM
You guys DEFINITELY have too much time on your hands :rofl: ( :hug: )

killingtime
11th-October-2005, 10:03 AM
You guys DEFINITELY have too much time on your hands :rofl: ( :hug: )

Well I ran out of PM space so I exported and deleted them. I just figured I'd have a way to read them after that :D.

drathzel
11th-October-2005, 04:15 PM
Wooooosh!
Hope it works for all of you that understood that.
:yeah:


Sometime I'll write a perl script to turn the text output into mbox format files...

(Expecting to hear another whoosh any moment now...)

double :yeah:

killingtime
11th-October-2005, 04:18 PM
ducasi
Sometime I'll write a perl script to turn the text output into mbox format files...

(Expecting to hear another whoosh any moment now...)
double :yeah:

It basically means you can read the messages using an email client. I like where he is coming from.

DavidY
11th-October-2005, 06:57 PM
You guys DEFINITELY have too much time on your hands :rofl: ( :hug: )It didn't take too much time to use Access. The Access import wizard was nearly right 1st time - just needed to tweak the fields a bit (to set up memo fields if I remember rightly) then import again. Then use another wizard to set up an Access automatic form and I can see all my messages (& it's also dead easy to search them or show them in a different order).

Like killingtime I had to delete some PMs due to full mailbox - unless you want to lose them altogether it seems reasonable for us to work out our various ways to view them...

LMC
11th-October-2005, 08:54 PM
Like killingtime I had to delete some PMs due to full mailbox - unless you want to lose them altogether it seems reasonable for us to work out our various ways to view them...
I'm not as clever as you guys - I paid fifteen quid instead... :wink:

EDIT: just realised that you're paid up DavidY - 4000 messages and you still ran out of space :eek:

DavidY
11th-October-2005, 10:14 PM
I'm not as clever as you guys - I paid fifteen quid instead... :wink:

EDIT: just realised that you're paid up DavidY - 4000 messages and you still ran out of space :eek:I'm paid up now - but I let my membership lapse a while ago though so I ran out of space and had to do some hasty deletion so I could still receive messages. (But even now I'm paid up, I only have space for 2,000 :confused: )