Clean XHTML of shooting ranges data

My goal is to upload a comprehensive list of shooting ranges to Google Maps (see prior posting).

Why? I just think it would be cool to visualize places to shoot in Michigan.

Plus, once they are in there, I can see next steps, like creating a custom map of just the ranges that host matches for the Central Michigan Rifle and Pistol League shoots.

So, to accomplish this, here are the steps I’ve thought of.

  1. Clean the source code from the NRA page of ranges in Michigan into a valid codebase that can be more easily parsed
  2. Create a prototype of the form that data needs to take to be uploaded to a Google Map (looks like a KML file will do)
  3. Write an XSL document to use to transform the cleaned code (#1) to match the structure for the KML doc (#2)
  4. Run the XSL tranformation and then upload the resulting KML document to Google Maps

Just for the record, here’s the cleaned source code (#1): 2007.12.16-shooting-ranges.html

We need a “credit” attribute in XHTML

The XHTML 2.0 draft document by the W3C includes some promising attributes for elements. For instance, a navigation list could have a role with a value of sitemap. I.e.: <nl role="sitemap">

That’s cool. Think on that a bit, o ye of semantic persuasion. The potential benefits of this type of specificity in standard markup is great.

Now, that said, I was working on a site that I hope to launch tomorrow, and I would have loved to use an attribute like credit for image elements. It would be used to specify photo credits for a couple images I’m using, plus on some banners, I could have credited the designer who put them together.

It would look something like this: <img src="cool.jpg" alt="Illustration of a calico cat in a beret playing the saxophone." credit="J. Smith, Illustrator for Cool Colors, Inc." />

We could throw this information into the alt text, but it doesn’t really belong there, since the alt text is supposed to describe the contents of the image. We could also use the title attribute, but it would be nice to reserve that for slightly more pertinent information.

Today, I just added credit information in as comments in the markup. It was an adequate solution, I think, but will never be picked up by any user-agent.

xsl to tranform xhtml pages

I don’t know why it took me this long to realize this. I’ve been writing xhtml for a couple years now, and around the same time I started playing with xsl stylesheets, but it just occurred to me in a real way that I can probably use xslt to transform my xhtml pages (at my business site, for instance) into forms more useful to other devices. Cell phones and PDAs, for instance.

It probably took me so long because XHTML looks so much like HTML to me, that it didn’t completely sink in that it is truly XML. Yet it is, namespaces and all.

Now that I realize this, I appreciate even more it’s role as an intermediary between html and xml. XHTML doesn’t need xsl to transform it or style it. It is so close to real html that even older browsers can handle it fine, and it works very smoothly with css as is.

So, this realization basically just means that making my site more available on handhelds is even easier than I first thought. Granted, I haven’t gotten into the sticky details of it all yet…