XSLT + CSS tutorial pubbed

"Use Cascading Stylesheets to display XML, Part 3"

CSS isn't just for HTML anymore! Learn to combine the strengths of CSS with those of XSLT and fine-tune your XML presentation in a browser.

In parts 1 and 2 of this tutorial series, Uche Ogbuji has shown how to use Cascading Stylesheets (CSS) to display XML in browsers, presenting basic and advanced techniques. Although some people see XSLT and CSS as opposing technologies, they are actually very complementary. CSS cannot, and is not designed to, handle many XML rendering tasks. You can use XSLT for many such tasks, and even manage the CSS that is still used to fine-tune the presentation. This tutorial covers techniques for using XSLT to process XML in association with CSS.

Anyone who works with XML should take this tutorial. Even if CSS and XSLT don't cover your needs for production Web publishing, they are great tools for general processing, debugging, and experimentation. They offer rich interaction with other XML technologies and you'll be likely to run into CSS and XSLT even when you least expect them.

This tutorial, third in a series, discusses XSLT techniques for working with CSS for HTML or XML output. The approach very step-by-step, and includes many examples (including expected display in Firefox).

If you're wanting to get more of a background learning how to use CSS with XML, see the previous tutorials in the series:

The response has been very positive to the first two. Here is what has been posted through the feedback form according to my editor:

"Use CSS to display XML, Part 1"
Average rating: 4.03 (out of 5.00)
Responses received: 33
"Excellent concise overview. Thanks."
"very nice presentation of the fundamentals with excellent examples"
"Good introduction. Needs a more dramatic example."
"Nicely done thanks .."
"Only had a quick read this time but I'm sure a full going over will improve my XML/CSS skills no end!"
"Hi:After several weeks of reading several books and posting to several list, you very simply provided me with an answer to my very simple question, which was "How can I present xml data using css?"Thanks."
"I already use CSS but this tutorial taught me some new tricks on generating content with CSS."

"Use CSS to display XML, Part 2"
Average rating: 4.00 (out of 5.00)
Responses received: 9
Comments: none

[Uche Ogbuji]

via Copia

Hacking in the name of IE

I finally broke down and made Copia safe for MSIE. When I first set up the site, I tweaked the IE look a bit, but it was such a frustrating exercise that I gave up once satisfied with its appearance on FireFox and Safari (I need to install Opera for testing). Last night I found this excellent Wiki resource and soon got things sorted out. In the process I was alerted to the fact that Copia gets rendered in quirks mode, which is not what we want. I think I know how to fix most of the problems, but some issues are buried in PyBlosxom and plug-ins code, I think, so it may have to wait until my next burst of energy before we can sport one of those fly "valid ?HTML ?" icons.

[Uche Ogbuji]

via Copia

Yet another pretty damn cool Wiki


Maybe these are all old hat, but not too long after discovering Wiktionary, I've come across another cool Wiki version of a classic resource. Wikinews is news by open community contribution. Terrifying or edifying prospect, based on your point of view. In my view, it's a nice opening for me to find stuff, and then do my own research to check up on it.

The coverage seems to be a bit laggy, and coverage is a bit spotty (a search for "Nigeria" brought up only one storage all month). All this is as expected for a volunteer-run site. It's a neat idea and neat execution, natheless.

[Uche Ogbuji]

via Copia

NOAA's arcs: the auroral oval

Auroral Activity extrapolated from the NOAA POES satellite

The only times I can remember seeing the Aurora Borealis (I've never been south of the equator, so no chance of having seen the Aurora Australis were once near Ashland, Wisconsin, and, surprisingly (to me), once here in Colorado. Lori and I were driving along and thought there was a strange shimmer in the sky. We then saw many other cars pulled over to get a better look. We followed suit and watched the show. On the NOAA page I can wistfully look from time to time to see whether there is any chance of catching the show again without having to venture pole-wards of either 45th parallel in Winter.

[Uche Ogbuji]

via Copia

Reconsidering blogrolls (and what the heck are "folks", anyway?)

In Shelley Powers entries "Ms Pancake" and "Let’s keep the Blogroll and throw away the writing", I've learned that there is some controversy about blogrolls. When I threw together Copia I tossed in a blogroll, which was just a random list of blogs I read. I hardly worried that the list would grow too long because I have limited time for reading blogs.

Shelley's posts made me think about the matter more carefully. To draw the basic lesson out of the long and cantankerous points in her blog entries (and comments), a blog is about communication, and in most cases communication within a circle (if an open and, one hopes, expanding one). Based on that line of thinking, Chime and I had a discussion and thought it would be best if rather than having a "blogroll" list of blogs we read, we had a list of other Weblogs with which we have some more direct and reciprocal connection. This includes people with whom we've had personal and professional relationships, and also people who have taken the time to engage us here on Copia. There is still some arbitrariness to this approach, and there is some risk of turning such a listing into the manifestation of a mutual back-slapping club, but it does feel more rightly to me. We do plan to post an OPML as a link on the page template, so people can check out what feeds we read (if they care); this feels the right compromise to me.

So there you have it. The list of "folks" on the left hand side, are people we feel to be in the Copia circle. We hope and expect it will expand.

[Uche Ogbuji]

via Copia

Media type for .xslt

Apache uses /etc/mime.types by default to map file extensions to Internet media types (IMTs), a.k.a. mime types. Unfortunately, for most Linux distros this file does not have an entry for .xslt, just .xsl (Fedora Core 3 doesn't even cover .dtd, though SuSE does). I prefer the .xslt, although I admit that preference is a crufty one, dating from before .fo because mt edominant extension for XSL- FO. I ended up hacking my IMT mapping to make sure it has:

text/xml                        xml dtd xsl xslt

I had to restart apache2 for this to take. I expect Apache caches the mappings.

Of course, in that move I sidestepped the whole debate over XML media types ( 1 2 3 4 5 6 7 8), etc. In particular, I chose not to use application/xml or `application/xml +xslt`, in part because I was unsure of UA compatibility. And don't even ask about Microsoft's rogue text/xsl, lest I embark on a long polemic about corruption and pestilence.

[Uche Ogbuji]

via Copia

Don't wait for your distributor; upgrade that Firefox RPM right away

"HOWTO: How to build Firefox 1.0.4 RPM from Nightly Build", Thomas Chung

This morning, I’ve been seeing a lot of “Firefox exploits” in various news sites including [SNIP LIST]. This makes me to think “hmm, how long do we have to wait until Fedora Project releases their official Firefox updates?” “Is there a faster way of getting the latest Firefox build like RIGHT NOW?”

Yeah, brah. Just what I was wondering. See also "More Details on Arbitrary Code Execution Vulnerability".

The answer is YES! We can build Firefox 1.0.4 RPM from Mozilla/Firefox Nighlty Build Tree.

Oh. Smack. Let's do it.

First, I followed instructions in "HOWTO: How to create rpmbuild directory". You can probably skip this part if you don't mind a root-based RPM build, but I'll be wanting to do some Fedora RPM hacking later on so I might as well. As root, I installed the rpmdevtools RPM

# wget ftp://download.fedora.redhat.com/pub/fedora/linux/extras/3/i386/fedora-rpmdevtools-1.0-1.noarch.rpm
# rpm -i fedora-rpmdevtools-1.0-1.noarch.rpm

Then as my own user:

$ fedora-buildrpmtree

There'll be no output, but you should now find:

$ ls rpmbuild/

$ cd ~/rpmbuild/SOURCES/
$ wget http://ftp.mozilla.org/pub/mozilla.org/firefox/nightly/latest-aviary1.0.1/firefox-1.0.4.en-US.linux-i686.tar.gz

Right now this build is the same as the release candidate announced by Asa Dotzler.

$ wget http://fedoranews.org/tchung/firefox/nightly/20050509/firefox.desktop
$ wget http://fedoranews.org/tchung/firefox/nightly/20050509/firefox.png
$ cd ../SPECS/
$ wget http://fedoranews.org/tchung/firefox/nightly/20050509/firefox.spec
$ cd
$ rpmbuild -ba ~/rpmbuild/SPECS/firefox.spec
$ sudo rpm -Uvh ~/rpmbuild/RPMS/i386/firefox-1.0.4-20050509.i386.rpm

You might have to su to root rather than sudo on that last command, depending on your set-up. Now just checking:

$ rpm -q firefox

Bet! There goes that round of 'spoits (let's hope).

[Uche Ogbuji]

via Copia

A couple of Amara/CherryPy Demos

As I've mentioned, I've been playing with Amara/4Suite and CherryPy. Luis Miguel Morillas has been as well. We're both taking things slowly, pursuing it from different angles.

Luis has a "Web-based docbook browser and processor using CherryPy and Amara.". It's a very simple script for rendering as Web content an index and chapters of Mark Pilgrim's Dive into Python book as XML and XML+CSS (which seems to be creeping into the mainstream?).

I also have a demo as part of Amara, cherrypy-xml- inspector.py, which allows you to "inspect" an XML document, through a Web form using CherryPy and Amara. You can load any document off the Web and then enter in an amara expression, such as "doc.html.head.title" and get the result.

[Uche Ogbuji]

via Copia