Watts (chipotle) wrote,

Nocturnal XSL

I'm settling back to my college sleeping schedule, I think--going to bed at midnight (on workdays) was late for me. Now I've been regularly hitting bed past 1:00; the last few nights it's been past 2:00.</p>

My apartment cleaning quest continues. I've got many more things to ferry out of my bedroom, many more cartons and boxes to start packing, and the dreaded comics-sorting. The local used book store turns out to mostly be an antique hardcover dealer and wasn't interested in any of my stuff, so I'll be ferrying the three (!) boxes up the road. I got $64 for my used CDs. There are more CDs I could dump if I was being honest with myself; I have no idea how much I'll get for the books. It's occurred to me that once I get a sufficient amount of junk cleared out of the apartment, I could try to sell the furniture I'm not taking with me that's still in reasonable shape, reasonable shape defined as "good enough for someone to offer me money for"--the dining room table, a few dining room chairs (the ones that aren't in bad shape). The old coffee table and the end tables that have been commandeered as computer equipment stands. The entertainment center which is at once a little too big for my apartment and too small to let me get a TV set bigger than the one I have (once that day comes). Maybe the sofa, if I can find a way to minimize the rip in it.

I'm feeling so mercenary!

Yesterday's main work--and it was work, believe me--was producing the XSL to take my XML résumé and convert it to HTML and RTF. XML is "Extensible Markup Language," and XSL is "Extensible Style Language," so it's easy for web designers to do a mental map: XSL is to XML as CSS is to HTML. That's what I used to think. Bzzzt! Wrong answer. It's better to think of XSL as a scripting language written in XML. For my applications, I feed the XML résumé with the appropriate XSL script to an XSLT processor ("XSL transformation"), and either an HTML or RTF version of my résumé pops out the other side.

I'll spare the grisly details, but the two main points I learned in this exercise were:

  1. Making XSL handle elements that can appear inside any other element (like, say, <EM>emphasis</EM>) is trickier than it looks.
  2. RTF is a beast of a markup specification.

But, at 2:00 in the morning (surprise), I modified my Design Work page to add a TAR file with the XML source and the two XSL sheets, along with a Makefile. There's also a link directly to the XML résumé for browsers that process XSLT, which are: Netscape 6+ or Mozilla. (In a canonically Microsoft approach, IE 6 could do it brilliantly, except that it insists that the style sheet be referred to with the MIME type "text/xsl" when the W3C specification clearly requires "text/xml".)

So does this actually prove useful to me beyond as an exercise? Actually, yes. I can modify the XML document and just type "make" and get new résumés, always in sync with one another. When I learn XSL-FO ("formatting objects") I can set things up so it'll create a PDF version automatically, too. And it also gives me a valid and useful XML document to poke at with XML-specific editors; at some point in the indefinite future I might try making a DTD for the résumé.

But, first, I need to make that hypothetical Flash MX example real, and then start learning JSP.


  • Post a new comment


    Anonymous comments are disabled in this journal

    default userpic

    Your reply will be screened

    Your IP address will be recorded