# VBForums CodeBank > CodeBank - Other >  [XML+XSLT+CSS] XSL Stylesheet for vBulletin Private Message Archive

## penagate

I have created an XSLT stylesheet for applying to vBulletin Private Message archive files in XML format. This stylesheet will present the XML archive as readable XHTML/HTML with expandable and contractable folders/messages.

*Demonstration screenshot:*


*Browser compatibility:*
The XSLT file is available in two versions. One is a XHTML 1.1 version for standards compliant browsers, the other is an Internet Explorer-specific version.

I have tested the appropriate versions in Firefox and IE. Opera does not (yet, version 9 should) support XSLT. Safari does, but I am unable to test in it (if anyone has Safari could you please tell me?) Other Gecko based browsers (Flock, Camino, etc.) should work as Firefox does.

The expansion/contraction feature requires Javascript. By default all nodes are shown expanded, so the page remains compatible if Javascript is disabled. In the non-IE stylesheet, with Javascript enabled the appearance defaults to all contracted. For some reason, Expand/Contract All is _extremely_ slow in IE, so appearance defaults to all expanded to reduce the load time.

*Features:*
Standards compliant version features embedded expand/contract images (through data URIs) and a fixed position quick links bar at the top right hand corner of the screen.

Fixed positioning is possible in IE through some trickery but I did not feel it was worth it so that is omitted from the IE version. Data URI images in that version are replaced with text (does not look quite as good but no functional difference).

*To use:*
Download and extract the attached ZIP file;Save the appropriate version XSL file to the same directory where your XML Private Message archives are stored (for non-IE users: vb-private-messages-std.xsl, for IE users: vb-private-messages-ie.xsl);Open each XML file, _underneath_ the XML prolog (this line:
<?xml version="1.0" encoding="ISO-8859-1"?>) insert one of these two lines to link it to the stylesheet:
For non-IE users:
<?xml-stylesheet type="text/xsl" href="vb-private-messages-std.xsl"?>For IE users:
<?xml-stylesheet type="text/xsl" href="vb-private-messages-ie.xsl"?>Open the XML file in your browser. You should see a formatted usable version of the Private Message archive file.

I hope this assists forum users who download their PM archives in XML format and have been finding them difficult to make use of.


*Note:* There is one drawback and that is that vB codes are not parsed but rather simply shown as they appear in the message text. There is no way to convert vB codes into (X)HTML using an XSL transformation alone.
- P

----------


## si_the_geek

Very nice, I'm sure I'll make good use of this.  :Smilie: 

Would it be possible to have the From/To listed for each item, as well as the subject?

If so..  I realise there is no way to tell which of the two fields is yourself, would it be possible to have a hidden field somewhere, to hide whichever of the from/to is yourself?

----------


## penagate

From and To are already present  :Wink: 

I'll see what I can do about hiding self.

----------


## penagate

Oh, did you mean when the message is collapsed?

----------


## si_the_geek

Time to clarify  :Big Grin: 

I meant on the same line as the subject - so you don't need to "open" a message to see who it was from/to.

----------


## penagate

Updates requested by si!

- To/From user now displays on the message heading line. In the Inbox the From field is shown, in Sent Items the To field is shown. In all other folders both are displayed.

- Also various IE fixes.

The latest zip is attached to the first post.

*Edit:* Fixed AWOL attachment  :Blush:

----------


## RobDog888

Finally, I have been downloading my PMs for a long time now and this will make it easier to locate/read archived messages.  :Thumb:

----------

