Tag Archives: xml

A fun day… for some hacking.

Over the course of the day, I:

  • Tweaked the package complement on my workstation where last night I did an installation of the Fedora 15 pre-release tree
  • Identified some weirdness in my local Eclipse environment and got things in better shape for later work
  • Got a good start on some user documentation for PulseCaster
  • Took my daughter to the skate rink, and managed to skate for at least a little while before realizing I was having a rough time because my kingpin bolts are just way too freakin’ tight
  • Figured out how to adjust said kingpin bolts and made a note to take care of that before next week
  • Took my son out for some errands and lunch — a nice trip and a good chance to exercise my patience muscles
  • As a reward, bought some beer and a couple decent malbecs
  • After returning home, cleared out some obsolete packages hanging around in Bodhi and begging for death
  • Built and pushed a new update of PulseCaster to fix some bugs
  • Built and pushed a refreshed upstream version of xmlstarlet
  • Played with the dog
  • Came back and turned up a French trance station I got into recently (for some reason, monotonous, non-vocal electronica seems to help me work more efficiently… probably since there are few lyrics to listen to and digest mentally)
  • Went through some email to reduce backlog for Monday
  • Triaged a crummy gnome-system-monitor bug affecting people with more than 4 CPU cores (like me)
  • Had dinner with the family (Eleya made a fabulous corned beef, first timer but it was pretty much perfect!)
  • Came back to the desk to find that the superhuman Matthias Clasen had fixed the gnome-system-monitor bug in question, and built and pushed an update out
  • Installed said update with many thanks to Matthias, tested, and provided feedback

So of course, my definition of hacking is not nearly what some of my colleagues manage daily. But I feel like attacking some of this stuff on weekends and working on my own GNOME-ish projects are starting to give me a better fundamental understanding of some of the plumbing at work in the desktop. And of course, it gives me a wh0le new appreciation for it as well. I’m now rocking GNOME 3.0 pre-releases on both my main systems here at home, my laptop and my big workstation, and loving it.

I’ve contributed a few bug reports and to a small portion of the GNOME 3.0 user documentation for this release. It was lots of fun and made me feel connected with the release process for something I use every day that will be an intrinsic part of Fedora 15 when it arrives. It’s a great feeling to be just cranking on some little bits to help others, and just as much as ever, I know that if everyone does the same, free software has a future that is even brighter than the (already well-lit) present.

XML editing with Emacs.

I’ve been using GNU Emacs ever since I started working with the Fedora documentation team years ago. I wouldn’t call myself a power user by any means, but it handles my modest needs very well. Other people may have different preferences, which is fine. (Holy wars to /dev/null please.)

In the intervening years some really nice tools have evolved for dealing with different kinds of XML documents. I used to use the old psgml-mode to do editing of XML documents, but nowadays things are even more elegant and functional with nxml-mode. In truth, I was probably late to switch, simply because I didn’t have time to fix that which wasn’t broken.

However, ultimately psgml fell out of favor and the switch was necessary. But I discovered an array of helpful configurations that made XML editing even easier than before. I use these tools for editing DocBook XML, but they’re equally powerful for other schemas as well. For instance, you could use nxml-mode to hand-edit libvirt domain files with good confidence on their validity.

You can probably find directions like these (or even better) in a lot of places around the web. What I found difficult about the process was discovering the why as opposed to the what to do. How does all this stuff work, anyhow? None of the pages I read did a great job at explaining that. Admittedly, some of them were parts of much larger works, but I just wanted to get something done, not read an entire book. In writing the above page, I thought to myself, How can I improve this situation for the next person?

The key to solving that problem was this fantastic post by Mel Chua (and her lightning talk at FUDCon Tempe) where she talked about baking croissants. Short summary: it’s not enough to write a recipe and expect people to follow it, if your goal is to get people baking who aren’t bakers by trade. You have to take the time to fill in all the gaps.

So the result is this page I added to the Fedora wiki: How to use Emacs for XML editing.

Thanks, Mel, for the great advice. If anyone finds something wrong with that page, why bother commenting here? Just edit the wiki page if you’re a Fedora contributor (in other words, someone with an account and completed CLA). I’ll get notified when you do and everyone can benefit from your changes.

UPDATE: I revised the page slightly to give some needed background information up front and make it even more Mel-icious. Also I slightly edited this post to eliminate some awkwardness from where I rearranged text.

Notes on a weekend.

It was a nice weekend even though it was blisteringly hot. Saturday my wife took my daughter out for haircuts and some shopping, so I stayed at home with Trouble (we should probably just get around to changing my son’s name legally) and we played a bit. I also checked to see how his reading is coming along, and at age 4.5 he’s doing about as well as we could possibly hope. He trips a bit on words like “casually” but generally he can read even things he’s never seen before at a decent speed.

I also tuned my wife’s old autoharp — which has been sitting in various closets since we moved in together close to 20 years ago — so my daughter could use it. In actuality it probably badly needs new strings, but those generally cost upward of $60 and I have yet to see if Evie will keep up with it. They’re kind of limited, but very easy to play, and there’s a huge number of songs that are within reach with just a handful of chords. She seemed pretty psyched about it, but she’s much more into reading, writing, and making crafts.

I worked a little on a revamp of the Fedora release notes to try and get them building with publican. However, I ran into some pretty thorny problems because publican doesn’t seem to do things with XML in an XML-ish way. Instead, it relies on a lot of awk and sed commands to query or change the XML during the validation, translation, and build processes.

I remember several years ago when I was one of the people working on the Fedora documentation tool chain, that I had initially tried doing a lot of work this same way. The downfall in that methodology is it makes assumptions about the way the input document is physically formatted, which is a huge fail when it comes to XML (as I later learned, slowly and painfully). It also makes life very hard for people who want to use your tools on their pre-existing documents. Instead, there are a large variety of ways to do these same things programmatically using XSLT. Your input document is “understood” as a set of data nodes, and can be queried, manipulated, and output in ways that are sensible.

In any case, I was pretty disappointed, and although I was initially very enthusiastic about getting our Fedora docs working using this toolchain, I’m a little less so now. I’ll probably see if I can’t pull out some specific problems and file them as bugs. That means I should probably publish a git repository of the document on which I’m working, as a sort of test for the toolchain. Hopefully I’ll get some time for that this week.

Saturday night I stayed up a bit and watched Le scaphandre et le papillon (The Diving Bell and the Butterfly), which was simply superb. The lead, Mathieu Amalric, was great, but the actor who most surprised me was Max von Sydow as his father — phenomenal performance.

On Sunday morning Evie and I went out for some more bike riding practice. There were a couple of near-spills, but nothing too traumatic, other than the usual whining because she couldn’t immediately do it perfectly. I think it’s just a matter of a few more practices and she’ll be confident enough to start turning. By lunchtime, it was practically too hot to be out, but nevertheless I was running alongside her down the street as she went. We finished up covered with sweat, and went in to get cleaned up and have lunch.

Last night, Eleya and I watched another great film — El Orfanato (The Orphanage). It’s a Spanish language film that purports to be a horror movie, but only in the same sense as The Sixth Sense. Notably, it was produced by Guillermo del Toro, who seems to be racking up quite the résumé of tragedic horror fantasies featuring children. Well worth seeing.