« Libraries 411, library locator service | Main | Games in the children's room of your library »

21 January 2006

Sample card catalog output using XSLT and CSS from the AADL catalog

Tonight was as good a night as any to learn a little bit, and so I reinvented John Blyberg's virtual catalog card using XSLT and CSS. It's very rough right now, but the results are good enough to show.

The URL that shows everything is this uber-long monstrosity:

http://www.w3.org/2000/06/webdata/xslt?xslfile=http%3A%2F%2Fwww.superpatron.com%2Faadlexample.xsl&xmlfile=http%3A%2F%2Fwww.aadl.org%2Fcat%2Frest%2Frecord%2F1249810&transform=Submit

Go ahead, click, it won't bite. See?

In real life you would not use that - in real life the XML from the catalog would have a style sheet with it of some kind. But just to play along, here's how you parse that.

The first bit from w3.org is the public xslt translator they run. Be gentle, and don't expect it to be a production service.

The second part is the XSL file, http://www.superpatron.com/aadlexample.xsl . It's a programming language written in XML that takes an XML file and turns it into anything, very typically another XML (or HTML) file. Your web browser has that programming language built into it. If you look at the page it's not actually all that complicated - you're essentially grabbing elements from one page and plunking them into a template. I'm at about the edge of my knowledge with this file right now, but it does work....

This xsl file in turn includes a CSS file, http://www.superpatron.com/aadlexample.css . The CSS is a style sheet that makes the page look pretty - it selects things like fonts, background images, spacing, and other layout elements for a page. The CSS here is very minimal. You'll see that it includes a background image from John's card catalog collection on Flickr.

Finally, there's an XML file, http://www.aadl.org/cat/rest/record/1249810 , which has the raw catalog information from the AADL's site. It is marked up in such a way that all of the fields in it are readily accessable. (The only thing I noticed missing from it was subject headings.) The XML could, if it wanted to, specify an external XSL file to be interpreted by the browser.

String all of this stuff together, and you get this:

Firefoxscreensnapz001

but this is now data, not just an image, and you could (though i stopped before I did) have some of the elements be live links.

Technorati Tags: , , , , , ,

Comments

Yay! Love the XSLT hacks.

This is awesome. I love the idea of a catalog card with links. I tried to sell John on text instead of an image, but he was having too much fun with GD, the slacker.

Thanks Eli.

I did some more work on this today. It'll be invisible to most people, but if you have a COINS resolver for ISBNs, you'll have a link to your local library's holdings for this record. I also marked up the card in the "openurl" microformat which might some day be more widely parsable.

Now to find some cardstock that's more to my liking :)

Hah, the link produces:


Using org.apache.xerces.parsers.SAXParser
Exception net.sf.saxon.trans.DynamicError: org.xml.sax.SAXParseException: White spaces are required between publicId and systemId.
org.xml.sax.SAXParseException: White spaces are required between publicId and systemId.

Looks like there is some more debugging to do.

yup, it's broken.

(and it could have broken in a few places - this was cobbled together from web services not guaranteed to be stable, so I'm inclined to leave it be until the next round of hacking)

Verify your Comment

Previewing your Comment

This is only a preview. Your comment has not yet been posted.

Working...
Your comment could not be posted. Error type:
Your comment has been posted. Post another comment

The letters and numbers you entered did not match the image. Please try again.

As a final step before posting your comment, enter the letters and numbers you see in the image below. This prevents automated programs from posting comments.

Having trouble reading this image? View an alternate.

Working...

Post a comment

What they're saying about Superpatron

  • So you've got Ed exploring the possibility space, and John working to enlarge that space, and together they've created a virtuous cycle of innovation. Now this is obviously an extreme example. You are not going to find a superpatron of Ed's caliber and a superlibrarian of John's caliber in every town. But I think the dynamic at work there can apply more broadly. And if it does, it will matter that these patrons and librarians are situated in a local context. (Jon Udell, Remixing the Library, GRL2020)
  • Der Supernutzer beschreibt 10 Möglichkeiten, der Bibliothek zu helfen....Den wichtigsten Punkt hat er vergessen, ihn aber selbst erfüllt. Sozusagen als Präambel könnte man also anführen:

    “Übe konstruktive Kritik an der Bibliothek. Ohne Resonanz können die Leute da drin nicht wissen, was Du willst.” Infobib.de

  • How come only some books in the Google Book Search have “find in a library” links next to them? Diglet asks, and gets an answer, sort of a lame one if you ask me. update: Kevin mentioned in the comments that it would be great to see this for all books in Google Books. I went to bed thinking “Oh yeah, I should look into that….” and while I was sleeping, Superpatron, aka Ed Vielmetti solved the crime, er problem, and created a Greasemonkey script (a plug-in that you can run with Firefox) that does this for Ann Arbor and can be modified for any library. (Jessamyn West)
  • Curse you Superpatron! t's way past my bedtime, but the Ann Arbor Superpatron has been planting ideas in my head again… (Dave Pattern)
  • Superpatron is a blog run by a patron. The author posts entries about events and articles relevant to the library community, but does it with a patron point of view. (North Texas Regional Library System)
  • The blogosphere's resident "awesomest patron ever," Edward Vielmetti, appears in an article in School Library Journal about how he wrote a script tweaking (ahem, improving) Google Book Search. Vielmetti's blog, Superpatron, is one I read daily and highly recommend to anyone in libraries looking to get a very smart user's perspective. (Librarian In Black)
  • When I wrote him back, I called him the “AADL Super Patron,” which is very coincidental, since he has been planning to create a blog with almost the same name. Today, Superpatron is live and I’m sure it will quickly be filled with Ed’s terrific ideas about making libraries more responsive to patrons’ needs. So hurry up and subscribe already, ok? (Meredith Farkas)
  • The Superpatron (faster than a speeding reference librarian…) posts a presentation on the use of del.icio.us for research. Steven Cohen, Library Stuff
  • I've talked about Edward Vielmetti here before, but I never had the right name for him. Now I do. He's Superpatron! (Jenny Levine)
  • Last fall, in Ann Arbor, Michigan, I gave a talk entitled Superpatrons and Superlibrarians. Joining me for this week’s podcast are the two guys who inspired that talk. The superpatron is Ed Vielmetti, an old Internet hand who likes to mash up the services proviced by the Ann Arbor District Library. That’s possible because superlibrarian John Blyberg, who works at the AADL, has reconfigured his library’s online catalog system, adding RSS feeds and a full-blown API he calls PatREST. (Jon Udell)
  • Little did I know that when I pointed to Ed Vielmetti’s blog, I was not only coining a phrase, but providing the name for Ed’s brilliant new blog. Ed is that (unfortunately still) rare creature that not only groks the net in fullness, but also has use for his public library. (Eli Neiburger)
  • Die Ann Arbor District Library hat einen Nutzer, der sie liebt. Und nicht nur das, er schreibt darüber. Oliver Obst

mybloglog


Blog powered by TypePad