Data tricks

posted by Rob on April 11, 2008 11:40 AM

XSL.jpg

While it's very kind of Em to do some pimping on my behalf, it's clear to me that what chicks really dig is someone who has a good grasp of how abstruse programming languages can be combined with core business data to devise novel time-saving workflows. With that in mind, ladies, let's talk about XSL.

First off though, if you're hazy about what XML is, I've written what I think is a very painless introduction to it that doesn't assume you know how to program or hack into Skynet or anything. It's a PDF file and it's here.

So this is what XSL looks like (at least the way I write it.)
XSLsnippet.jpg
Hmm. Actually, I shouldn't have included that screen grab because now everyone will have stopped reading. So just try to forget you saw it. I just wanted to make the point that XSL is one of the strangest programming languages I've come across. It's designed to turn one kind of document into another. And unless you get clever about it, the input document will need to be formatted as XML and chances are the output document might be too. Why would you want to reformat one XML document into another? Well, here are three kinds of XML document:


  • Onix message (the industry standard way of telling someone about a book)

  • Web page (providided you write in the variant of HTML known as XHTML)

  • InDesign page (you have to create the layout yourself, but all the words can come in via XML)

You need to have the first kind. You might want to automatically generate the second and third kind. You need Onix messages to send out to people because that's what the industry increasingly runs on. But once you've produced those messages, they contain all the information needed to create a web page about each title or to take a blank catalogue layout and fill it with words about your books. And since what you're doing there is to turn one sort of XML document into two other kinds, it stands to reason you'd want to use a weird language like XSL.

We go a little bit further, actually, and regroup our data before creating things like web pages. So, we have an XSL 'program' which looks through the Onix messages for all of our titles and makes a list of all the author names it finds. Then it works back the other way, creating a web page for each author and adding to it information about each of their titles.

We also sneak in a bit of extra data to our Onix message in order to say what genre each title is in. The Onix standard already contains that sort of data in the form of BIC codes but, not to phrase it too technically, they suck. Or rather they tend not to group books in ways we find useful. And the titles of their groupings are too ugly to use without renaming them. And there's two different versions out there which creates quite a mess. So since we'd have to do some work to turn BIC codes into useful classifications, we took the easy way out and added our own codes (the Onix standard leaves space for that sort of thing, thank goodness).

Now, granted, writing all that code* takes a while. But it only needs doing once. Thereafter, turning Onix messages into other useful things like web pages takes moments and is automatic, as Em has described and demonstrated in some of her recent video tutorials. And that's the essence of satisfying IT: a bit of serious head-scratching and deep thought for a few days, but the pay-off is to save weeks of time later, and remove the repetitive drudgery from tasks like website and catalogue updates.

I'll post a bit more about this in the coming weeks; this is just a reminder of what we use this XML/XSL stuff for and why it might be useful to you even if you don't yet grasp the details.

Part II is here.


* 'code' means programs or software. But I can't quite bring myself to use those terms even though they're clearer. People who write code don't tend to say things like 'I did some programming the other day'. They 'write code'. They especially don't say 'I wrote a computer software application the other day'. Terms like that only occur on the BBC or in the Daily Mail.

spacer

Comments: 7


If that's what you think chicks really dig, I'd best have a heart to heart with you ... or introduce you to one of my girls.


Oh Lee, XSL certainly puts a tingle up and down *my* spine. Listen to one of my video tutorials and you'll see what I mean. Maybe you're a bit behind the times with regards to what girls like...


Is that an ageist response? Now, that would be truly behind the times!


Heh - for all I know you could be anything from 17 to 90!


Well, I've got a couple of girls who are closer to 17 than 90, and one who'll soon be a sound engineer (also indie film-maker) and can probably code most blokes under the table, but when it comes to what she and her mates dig in lads ... maybe publishers understand ONIX better than OFIX
(OFfline Information Exchange) - amongst real people!

P.S. But nevertheless tell Rob if he fancies an introduction to my code-wielding daughter, it can probably be arranged ...


Lee, your eldest is not going to thank you for this. Despite my ever-youthful appearance, I'm probably a lot closer to your age than hers. On the other hand, putting aside the girlfriend search for a minute, I'd love to meet an indie filmmaker/sound engineer. Half the stuff I read at the moment is interviews with filmmakers of one type or another.


OK, Rob, since you sound so nice, I'll come clean (as fresh snow): my daughter already has a partner (at the moment, but you know how these things are). However, she's planning to be in London sometime in the near future to cast Noise, so if you're really interested in indie filmmaking, email me.

And by the way, I'm also reading a lot of interviews with filmmakers at the moment - terrific stuff for writers. Have you seen The Conversations: Walter Murch and the Art of Editing Film by Ondaatje? Or the F&F series including such gems as Minghella on Minghella?

spacer

Post a comment

We love hearing from our readers, but please stay relevant and pleasant. The comments are for responding to the specific blog post above. If you have any other queries, please contact Snowbooks via email. Off-topic or offensive comments will be removed without notice.

To screen out automated spam, please answer the following very easy question:

What colour is nice, new snow?

(please use all lower-case characters for your answer; no capitals)


Back to the blog »