Povert

It's Pronounced "Pah-vert." You povert.

XSLT

Ok, I posted something about XSL a little while ago. I got over the hurdle I talked about there, so I took the post down.

I’m still pretty confused, though. I suppose that that’s the consequence of trying to learn by looking at other people’s source code (for once, “source code” actually seems slightly appropriate when talking about viewable stuff on the web). The whole relationship between css and xsl is pretty confusing to me, especially when you start doing transformations. Maybe I’m doing something wrong, but css linked from the xml file seems to do nothing once there’s an xsl file. Or, more specifically (or maybe not—I’m still a little confused), an xslt file.

There’s about 5–10 books at the library where I work. I think I’m going to check a few out. Like I said, I’m used to learning by looking at how other people do it. Not used to sitting down and reading a book to learn this kind of stuff. But I’ve done it before.

I know most of you have no idea what I’m talking about. You probably should have stopped reading halfway through the 2nd paragraph.

By the way, my little experimentation with XML/XSL led to Flapping Crane being inaccessible for an hour or so. Whoops. Screwed up some AddType settings in Apache.

One Response to “XSLT”

  1. Scooter Says:

    The css is usually applied sort of after the fact – that is to say, the XSL is used for making major structual changes to your XML/XHTML, including templating/recursion and scripted data manipulation, and then the css is used for adding UI features. An example – I have a chunk of XML data that I want to turn into a menu/navigation pane – I’m likely to turn it into X/HTML using XSL – divs, various tag names that I can key off of based on the data structure, etc. – and then use the CSS file to add colors, behaviors, borders, etc. Of course, you can overlap – put some of your javascript in the XSL, put in actual HTML tags other than simple divs and apply colors/etc. – but separating anything that changes the actual display is preferential so you can swap it out later with a simple stylesheet name change if you like. You can apply the CSS w/in your XSL, so you can parameterize what CSS gets applied. Works nicely – this one, below, isn’t parameterized, but you could just replace Test.css w/a parameter (as an example).

    stylesheet
    Test.css

Leave a Reply

Povert is proudly powered by WordPress
Entries (RSS) and Comments (RSS).