#112039 - 20/08/2002 06:52
Toby's playlist stylesheet, version 1
|
old hand
Registered: 30/07/2001
Posts: 1115
Loc: Lochcarron and Edinburgh
|
I'm attaching version 1 of my playlist stylesheet. Those who have used DSSSL stylesheets before should have no problem applying it to the XML file produced by the pre-prerelease (v42) JEmplode's "Export as XML" option (N.B. do not use "Export as Emplode XML", or you'll just get lots of SGML errors). Read the comments near the beginning of the file to find out what you can customise.
Readers who have not (knowingly) used DSSSL stylesheets before might like to wait for the Makefile, which includes more detailed instructions.
The stylesheet differs from eslange's MS Word macros in that it is platform-independent (though it may contain Jade-isms; let me know if you fix any), and in that it formats your playlist hierarchy structure, taking into account directives specified by the "print" tag on tunes and playlists. I freely admit that I've not tried the Word macros (not having MS Word), so I could be misunderstanding how they work.
Attachments
110361-empeg.dsl (183 downloads)
_________________________
Toby Speight 030103016 (80GB Mk2a, blue) 030102806 (0GB Mk2a, blue)
|
Top
|
|
|
|
#112040 - 20/08/2002 07:15
Makefile for Toby's playlist stylesheet
[Re: tms13]
|
old hand
Registered: 30/07/2001
Posts: 1115
Loc: Lochcarron and Edinburgh
|
Here's the Makefile.
Instructions are in the file; reproduced below for your convenience. - Prerequisites:
- Make sure you have OpenJade or another DSSSL processor that can produce RTF output.
- If you want to produce PostScript, you can do this with a GUI editor like AbiWord, but I've chosen Ted because it's easy to use in a Makefile.
- To make the booklet, I use the psutils package to shuffle pages.
- If you're running Debian, the above are installed very simply: "apt-get install openjade ted psutils". If you're not running Debian, you probably don't have /etc/papersize - you'll need to edit the PAPERSIZE variable below.
- This makefile is written for GNU make, so if you're using a different make, you'll need to do some editing.
- Obtain the empeg.dsl stylesheet and save it into this directory.
- Decide which parts of your player you want to print out. The stylesheet will print everything, starting with the root, but you can prune subtrees or individual tunes by adding a custom tag called
"print" with a value of "none" to the tune or playlist. The effect is as if you'd removed that tune or playlist from the player. Other values you can use for the "print" tag are "summary" to show only a count of tunes in a playlist, or "all" to prevent the stylesheet choosing a summary count. The default value is "normal", meaning use heuristics to decide whether do show child tunes. - Using a recent version of JEmplode (at least v42), export as XML to a file called playlists.xml (or change the definition of FILENAME below, but your file must end in ".xml") in the same directory as this Makefile and the stylesheet. Do not use "Export Emplode XML" as this is a different format (if you don't have "Export Emplode XML" in the menu, your JEmplode is too old).
- Type "make" to build the booklet as a postscript file called playlists-book.ps. If you just want the RTF (perhaps because you don't have Ted, and need to do the RTF->PS step by hand, or perhapsyou want to hand-edit the output), type "make playlists.rtf". You can then save your PostScript as playlists.ps and type "make" to finish making the booklet. Similarly, you can type "make playlists.ps" to make the full-size pages instead of the booklet.
- Print this on a duplex printer in the usual way (e.g. "lp playlists-book.ps"). The result is a stack of sheets; keeping these together, fold them in half and then into quarters. Staple through the second of these folds, then trim the first fold off to make a nice A6 booklet for the car.
This Makefile certainly has a Linux or Unix bias, and possibly a Debian one. Comments from people who adapt it for other environments will be greatly appreciated (as will reports of success without any adaptation). In particular, I'd like to receive comments or patches that make it work better on other systems without breaking it on my own environment.
Attachments
110367-Makefile (227 downloads)
_________________________
Toby Speight 030103016 (80GB Mk2a, blue) 030102806 (0GB Mk2a, blue)
|
Top
|
|
|
|
#112041 - 20/08/2002 07:18
Re: Makefile for Toby's playlist stylesheet
[Re: tms13]
|
old hand
Registered: 30/07/2001
Posts: 1115
Loc: Lochcarron and Edinburgh
|
What do I need to do to put these onto the Downloads section of RioCar.Org? It looks like that's for software that has some other canonical location, but I don't have any public server space from which to serve these two files. Is it possible for RioCar.Org to be the "home location" of my contribution?
_________________________
Toby Speight 030103016 (80GB Mk2a, blue) 030102806 (0GB Mk2a, blue)
|
Top
|
|
|
|
#112042 - 20/08/2002 12:27
Re: Makefile for Toby's playlist stylesheet
[Re: tms13]
|
old hand
Registered: 30/07/2000
Posts: 879
Loc: Germany (Ruhrgebiet)
|
That is possible. If you send the archive to one of the admins (including me), the will most probably upload it in a minute, giving you anything you need to add your own comment to it. If its size is below 100k, it is probably easier just to reference the attachment of a post to this BBS.
cu,
sven
_________________________
proud owner of MkII 40GB & MkIIa 60GB both lit by God and HiJacked by Lord
|
Top
|
|
|
|
#112043 - 20/08/2002 12:38
Toby's playlist stylesheet - uploading to RioCar
[Re: smu]
|
old hand
Registered: 30/07/2001
Posts: 1115
Loc: Lochcarron and Edinburgh
|
In reply to:
If its size is below 100k, it is probably easier just to reference the attachment of a post to this BBS.
It's just the two files already posted to this thread. I hadn't thought of referencing the attachments. I'm attaching a gzipped tarfile to this post (it's only 5K), in order to upload to RioCar.
Attachments
110469-stylesheet.tgz (113 downloads)
_________________________
Toby Speight 030103016 (80GB Mk2a, blue) 030102806 (0GB Mk2a, blue)
|
Top
|
|
|
|
#112044 - 20/08/2002 12:55
Re: Toby's playlist stylesheet - uploading to RioCar
[Re: tms13]
|
old hand
Registered: 30/07/2000
Posts: 879
Loc: Germany (Ruhrgebiet)
|
I just checked your upload and it is now in the downloads section. However I moved it to the Addons/applications area. I know a stylesheet is not an application per se, but it acts like one: It converts an input file into a differently formated output. So I would search for it in the applications section.
cu,
sven
_________________________
proud owner of MkII 40GB & MkIIa 60GB both lit by God and HiJacked by Lord
|
Top
|
|
|
|
#112045 - 21/08/2002 02:36
Re: Toby's playlist stylesheet - uploading to RioC
[Re: smu]
|
old hand
Registered: 30/07/2001
Posts: 1115
Loc: Lochcarron and Edinburgh
|
In reply to:
I moved it to the Addons/applications area
The reason I didn't put it there is because it's described as where "you will find addon programs that run directly on the empeg/RioCar", and the stylesheet doesn't meet that criterion. It's a tricky one to categorise.
_________________________
Toby Speight 030103016 (80GB Mk2a, blue) 030102806 (0GB Mk2a, blue)
|
Top
|
|
|
|
#112046 - 02/09/2002 07:01
Re: Toby's playlist stylesheet, version 1
[Re: tms13]
|
old hand
Registered: 30/07/2001
Posts: 1115
Loc: Lochcarron and Edinburgh
|
*bump*
I haven't had any reports of success with my stylesheet. I haven't had any failure reports either. Nor bug reports, nor feature requests.
From this, I conclude that nobody is interested in printing their playlists, despite the enthusiastic pleas for an early release, and that I wasted my time making them (excepting that they serve my puposes exactly, of course ). Please post some bug reports or wishlists to convince me otherwise.
Even stuff like, "I can't get Jade working" would be appreciated.
And if anyone has tried this stuff under Windows, I'd like to know how it went.
_________________________
Toby Speight 030103016 (80GB Mk2a, blue) 030102806 (0GB Mk2a, blue)
|
Top
|
|
|
|
#112047 - 03/09/2002 00:38
Re: Toby's playlist stylesheet, version 1
[Re: tms13]
|
old hand
Registered: 31/12/2001
Posts: 1109
Loc: Petaluma, CA
|
how would i go about trying it under windows i would love to make this work
_________________________
----
Justin Larsen
|
Top
|
|
|
|
#112048 - 03/09/2002 03:41
Re: Toby's playlist stylesheet, version 1
[Re: justinlarsen]
|
old hand
Registered: 30/07/2001
Posts: 1115
Loc: Lochcarron and Edinburgh
|
(Caveat: I'm not a Windows user, so I haven't tried any of this)
To use the stylesheets under Windows you will need Jade, available from the author's web site - go to http://www.jclark.com/jade/#getting and look for the link titled "binary distribution". Alternatively, you could use OpenJade which is the more active fork of Jade (and is what I use - on Linux - for development).
I think that Jade comes with a demo - use that to ensure that it's working correctly, then run Jade on your exported XML playlist from JEmplode, like "jade -t rtf -o playlist.rtf -d playlist.dsl xml.decl playlist.xml". This should give you an RTF file which you can manipulate (e.g. print) with most Windows word-processors.
If you have GNU make (and bash) installed, my Makefile may work for you. I'd like to hear from anyone who tries this.
_________________________
Toby Speight 030103016 (80GB Mk2a, blue) 030102806 (0GB Mk2a, blue)
|
Top
|
|
|
|
#112049 - 03/09/2002 06:57
Re: Toby's playlist stylesheet, version 1
[Re: tms13]
|
pooh-bah
Registered: 09/08/2000
Posts: 2091
Loc: Edinburgh, Scotland
|
I definitely do want my playlists and entire collection to be printable. Unfortunately I saw the word stylesheet and that turned my brain off so I never even checked out this thread.
I tried the excel spreadsheet version someone posted here a wee while back and it never worked, so I've just been manually printing from my csv file.
I am interested in doing it from Windows (sad, I know) as my only non-critical box usually runs Windows. So it is the one I have all my games, music and empeg stuff on.
I guess I could see if all the dependencies will work under Irix.
_________________________
Rory MkIIa, blue lit buttons, memory upgrade, 1Tb in Subaru Forester STi MkII, 240Gb in Mark Lord dock MkII, 80Gb SSD in dock
|
Top
|
|
|
|
#112050 - 03/09/2002 07:44
Re: Toby's playlist stylesheet, version 1
[Re: frog51]
|
old hand
Registered: 30/07/2001
Posts: 1115
Loc: Lochcarron and Edinburgh
|
As I've said elsewhere, the DSSSL stylesheet itself should work fine in OpenJade under Windows, but I'm not in a position to hand-hold with this. If you get OpenJade up and running, it should be straightforward to get it working on jEmplode's output. It's possible that you may need to tweak one or more of the environment variables that control it, but I would expect that the Windows binary distribution will explain what's needed, and possibly even do it for you.
If you get as far as error messages, post them here and I'll do my best to interpret them. If you get further, and now have pretty RTF files, definitely post here, so others know it can be done.
BTW, the makefile isn't necessary; it's just a convenience for those with a suitable environment. The only absolute prerequisite is Jade or OpenJade.
_________________________
Toby Speight 030103016 (80GB Mk2a, blue) 030102806 (0GB Mk2a, blue)
|
Top
|
|
|
|
#112051 - 03/09/2002 11:42
Re: Toby's playlist stylesheet, version 1
[Re: tms13]
|
veteran
Registered: 19/06/2000
Posts: 1495
Loc: US: CA
|
I played around last night a little with OpenJade and the playlist and ended up with an RTF that was slightly garbled. Probably just because I wasn't using the correct command switches. I'll try it again when I get home tonight. Should work just fine, the RTF I got was fairly readable, just had some extra white space, and was missing a lot of CR/LF's.
_________________________
Donato MkII/080000565 MkIIa/010101253 ricin.us
|
Top
|
|
|
|
#112052 - 03/09/2002 12:09
Re: Toby's playlist stylesheet, version 1
[Re: ricin]
|
old hand
Registered: 30/07/2001
Posts: 1115
Loc: Lochcarron and Edinburgh
|
Just out of interest, what did you read the RTF with? It's possible that OpenJade uses obscure features of RTF that some viewers might handle differently... Alternatively, it's possible that Windows CR-LF line endings might be causing problems somewhere along the way.
Also, did you enable any of the optional features (multi-column, scaling, etc.) of the stylesheet?
FWIW, I used Ted and AbiWord to look at my results. Ted doesn't support multicolumn output, and I've sometimes seen strange results due to my use of the keep: characteristic, but I worked around them for the viewers I have.
Glad you got as far as producing RTF, though. That's good news.
_________________________
Toby Speight 030103016 (80GB Mk2a, blue) 030102806 (0GB Mk2a, blue)
|
Top
|
|
|
|
#112053 - 03/09/2002 18:32
Re: Toby's playlist stylesheet, version 1
[Re: tms13]
|
Carpal Tunnel
Registered: 08/02/2002
Posts: 3411
|
Hmm, I'm trying to get it working on a Mandrake system. Lots of fun and games...After DLing, compiling and installing both openjade and Ted, and hacking the Makefile to find their default install locations (ok, I could have just put /usr/local/bin/ in my path...), I'm having a problem with declarations/xml.decl not being found. I can't find that anywhere on my system - do you know what package owns it?
_________________________
Mk2a 60GB Blue. Serial 030102962
sig.mp3: File Format not Valid.
|
Top
|
|
|
|
#112054 - 04/09/2002 03:20
Re: Toby's playlist stylesheet, version 1
[Re: genixia]
|
old hand
Registered: 30/07/2001
Posts: 1115
Loc: Lochcarron and Edinburgh
|
In reply to:
I'm having a problem with declarations/xml.decl not being found. I can't find that anywhere on my system - do you know what package owns it?
On my Debian system, it belongs to the "sgml-data" package (on which OpenJade depends):
sgml-data: /usr/lib/sgml/declaration/xml.decl
I had hoped to find it available on the W3C Web site, but they seem to want to quietly forget XML's origins to concentrate on their own XSchema stuff. Anyway, you can get a copy from OASIS. Does that help?
_________________________
Toby Speight 030103016 (80GB Mk2a, blue) 030102806 (0GB Mk2a, blue)
|
Top
|
|
|
|
#112055 - 04/09/2002 04:13
Re: Toby's playlist stylesheet, version 1
[Re: genixia]
|
old hand
Registered: 30/07/2001
Posts: 1115
Loc: Lochcarron and Edinburgh
|
If you installed OpenJade from the Mandrake RPM, I'm told that the SGML Declaration for XML is included, in /usr/share/sgml/openjade/pubtext/xml.dcl or similar (N.B. "dcl" rather than "decl"). Perhaps that helps?
_________________________
Toby Speight 030103016 (80GB Mk2a, blue) 030102806 (0GB Mk2a, blue)
|
Top
|
|
|
|
#112056 - 04/09/2002 07:52
Re: Toby's playlist stylesheet, version 1
[Re: tms13]
|
Carpal Tunnel
Registered: 08/02/2002
Posts: 3411
|
ok, that's what I thought. I tried with the xml.dcl included with openjade. (1.3.1 built from source) and it spews a whole load of errors:
booklet# make
/usr/local/bin/openjade -g -G -t rtf -o playlists.rtf -V '%scale-4up' -V '(define %tune-limit 2)' -V '(define %mixed-tune-ratio 0.5)' -d empeg.dsl /home/shared/empeg/booklet/xml.dcl playlists.xml
/usr/local/bin/openjade:playlists.xml:100:51:E: non SGML character number 0
/usr/local/bin/openjade:playlists.xml:100:51: open elements: player playlist[1] attribute[1] (#PCDATA[1])
/usr/local/bin/openjade:playlists.xml:351:57:E: non SGML character number 0
/usr/local/bin/openjade:playlists.xml:351:57: open elements: player playlist[1] attribute[1] (#PCDATA[1])
/usr/local/bin/openjade:playlists.xml:411:63:E: non SGML character number 0
/usr/local/bin/openjade:playlists.xml:411:63: open elements: player playlist[1] attribute[1] (#PCDATA[1])
/usr/local/bin/openjade:playlists.xml:804:53:E: non SGML character number 0
/usr/local/bin/openjade:playlists.xml:804:53: open elements: player playlist[1]
...
and so on.
I guess there's come version dependancies somewhere.
_________________________
Mk2a 60GB Blue. Serial 030102962
sig.mp3: File Format not Valid.
|
Top
|
|
|
|
#112057 - 04/09/2002 11:00
Re: Toby's playlist stylesheet, version 1
[Re: tms13]
|
veteran
Registered: 19/06/2000
Posts: 1495
Loc: US: CA
|
Just out of interest, what did you read the RTF with?
I tried it with Word 2000 and Word 2002.
Also, did you enable any of the optional features (multi-column, scaling, etc.) of the stylesheet?
Nope, just ran it plain. I think the problem might actually be the XML file I used. I didn't have a chance to try it last night (got sucked into a few games of BF1942 ), but I'll give it a shot again tonight with a fresh export and see what I come up with.
I haven't even bothered to try it in Linux yet, so I'll probably do that too.
_________________________
Donato MkII/080000565 MkIIa/010101253 ricin.us
|
Top
|
|
|
|
#112058 - 05/09/2002 03:46
Re: Toby's playlist stylesheet, version 1
[Re: genixia]
|
old hand
Registered: 30/07/2001
Posts: 1115
Loc: Lochcarron and Edinburgh
|
In reply to:
/usr/local/bin/openjade:playlists.xml:100:51:E: non SGML character number 0
/usr/local/bin/openjade:playlists.xml:100:51: open elements: player playlist[1] attribute[1] (#PCDATA[1])
That looks like you have NUL characters in your attributes somewhere, which is not supposed to happen - the jEmplode export code isn't expecting to deal with this, so it's being let out into the XML. Can you check line 100 (and 351, 411, 804, etc) of your playlists.xml and see if they contain odd non-printing characters such as NUL. Many editors won't show these characters, so if you like you could trim the file to those tune and/or playlist elements and post the result as an attachment (I'm guessing that the entire file is too big for the BBS). (In case it's not obvious, those error messages are in file:line:column format - ideal for Emacs's compilation-mode).
Since I wrote the new jEmplode XML exporter, I can't blame anyone else for this. On the upside, if my beliefs turn out to be correct, it should be fairly easy to fix jEmplode to deal with non-SGML characters in tags.
_________________________
Toby Speight 030103016 (80GB Mk2a, blue) 030102806 (0GB Mk2a, blue)
|
Top
|
|
|
|
#112059 - 05/09/2002 06:38
Re: Toby's playlist stylesheet, version 1
[Re: tms13]
|
Carpal Tunnel
Registered: 08/02/2002
Posts: 3411
|
Yep, that looks like it - the first four:
<attribute name="title">no_doubt-tragic_kingdom^@m3u</attribute>\
<attribute name="title">jump-the_myth_of_independance^@m3u</attribute>
<attribute name="title">joe_satriani-surfing_with_the_alien^@m3u</attribute>
<attribute name="title">massive_attack-blue_lines^@m3u</attribute>
It also has problems with character 151, which appears to be inserted by Allmusic comments:
<attribute name="comment">AMG EXPERT REVIEW: Metallica recorded so much mate
rial for Load ~W their first album in five years ~W that they had to leave many
songs unfinished, otherwise they would have missed their deadline. During the su
pporting tour for Load, they continued to work </attribute>
_________________________
Mk2a 60GB Blue. Serial 030102962
sig.mp3: File Format not Valid.
|
Top
|
|
|
|
#112060 - 05/09/2002 07:48
Re: Toby's playlist stylesheet, version 1
[Re: genixia]
|
old hand
Registered: 30/07/2001
Posts: 1115
Loc: Lochcarron and Edinburgh
|
The character set for XML is Unicode, which means that most of the character positions from 0 to 31 and all of those from 127 to 159 do not correspond to any characters (they are gaps in the encoding, reserved for control functions). We shouldn't be writing these from jEmplode (especially into a file labelled ISO-8859-1) - apologies for not considering that they may be present on some players.
For the short term, you're in a position to hand-edit your tags (or your XML playlist file, but you'd have to do it every time you exported) to remove the troublesome characters.
For the long term, how should these characters be written to the output? Options include "\000" octal notation, "^@" caret notation, inserting a numeric character reference "�". I'm a bit wary of the last one, as I think it might cause problems downstream with the RTF output.
For the 128-159 range, there is also the option of assuming that these come from a Windows-1252 system and replacing them with character references to the characters at the corresponding positions in windows-1252. E.g. for your character 151, it would be replaced with "—" or "—" (value from the Windows-1252 mapping table from the Unicode Consortium).
Opinions?
P.S. Thanks, genixia, for investigating this.
P.P.S. I'll be unresponsive until Monday; I'll deal with stuff on my return.
_________________________
Toby Speight 030103016 (80GB Mk2a, blue) 030102806 (0GB Mk2a, blue)
|
Top
|
|
|
|
#112061 - 05/09/2002 07:53
Re: Toby's playlist stylesheet, version 1
[Re: genixia]
|
old hand
Registered: 30/07/2001
Posts: 1115
Loc: Lochcarron and Edinburgh
|
In reply to:
<attribute name="title">no_doubt-tragic_kingdom^@m3u</attribute>\
<attribute name="title">jump-the_myth_of_independance^@m3u</attribute>
<attribute name="title">joe_satriani-surfing_with_the_alien^@m3u</attribute>
<attribute name="title">massive_attack-blue_lines^@m3u</attribute>
I'm wondering where these came from. It looks like something has attempted to truncate a string by writing NUL into it, without realising that it's not a normal null-terminated string, but one with a length value. With what software (emplode, emptool, or jemplode) did you upload these playlists? I'd consider this a bug in the relevant uploader.
_________________________
Toby Speight 030103016 (80GB Mk2a, blue) 030102806 (0GB Mk2a, blue)
|
Top
|
|
|
|
#112062 - 05/09/2002 09:54
Re: Toby's playlist stylesheet, version 1
[Re: tms13]
|
Carpal Tunnel
Registered: 08/02/2002
Posts: 3411
|
I *think* that it was probably Emplode, but can't be 100%.
_________________________
Mk2a 60GB Blue. Serial 030102962
sig.mp3: File Format not Valid.
|
Top
|
|
|
|
#112063 - 06/09/2002 00:18
Re: Toby's playlist stylesheet, version 1
[Re: frog51]
|
journeyman
Registered: 16/11/2001
Posts: 74
Loc: Utrecht, Netherlands
|
Hello !
Yes I've read there are a lot of problems especially related to the fact I'm using 'comdlg.ocx' component inside the macro (resulting into 'module not found in form...', next to that there are security problems, but that one is simple to solve by yourself. Since almost all my PC's are setup for (programmers) development environment, I never ran into such problems since all component stuff are available.
Unfortunalty I'm very busy at the moment since we've some serious problems over here. When I see time, I will pick-up this stuff again. In the meantime I've a bare XP (Win+Off) operational with the same problems.
BTW: What are exactly your problems?
With regards,
Eize
|
Top
|
|
|
|
#112064 - 24/10/2002 07:42
Re: Toby's playlist stylesheet, version 1
[Re: tms13]
|
old hand
Registered: 30/07/2001
Posts: 1115
Loc: Lochcarron and Edinburgh
|
I've sent Mike an update to the XML exporting code, so you should expect it in the next JEmplode. - It truncates any names that contain the ASCII NUL character.
- It represents ASCII control characters using caret notation (Mmm, I didn't make an exception for TAB - hope nobody has tabs in their names/properties)
- It represents characters 128-159 by the characters occupying those positions in Windows-1252.
- It represents unmapped Windows-1252 positions and DELETE as '?' (question mark)
HTH.
_________________________
Toby Speight 030103016 (80GB Mk2a, blue) 030102806 (0GB Mk2a, blue)
|
Top
|
|
|
|
|
|