January 14, 2004

Valid XML

When the DNS was down, I didn't post. Then I managed to forget to post last night. Shame on me.

Mark Pilgrim writes about valid XML in terms of HTML or RSS or ATOM. Brent Simmons writes about why XML well formedness is a good thing.

For any newbies, here are the basics. XML is a file format that is generally self documenting, and lends itself very well to all kinds of structured documents. Apple uses a subset of this in it's property list format, and XHTML is simply (riiight) a redefinition of all the HTML tags as XML entities.

Now, what Brent suggests is that at the very least, your ATOM feed should be XML valid. That means every tag is ended and it is all nested properly. It doesn't mean that you won't put two <title> elements in your feed (which would be completely valid XML but invalid ATOM). It simply means that you can do all kinds of other stuff with your feed besides parse it with an ATOM aggregator.

I had another idea, which sort of takes off where Mark said that the client is the wrong place to check for and enforce validity. I agree there, for the most part.

My idea is this: the ATOM folks create an API that is simple to use. It's fast. It's basically so good you have no reason not to use it. It comes with Perl, Python, and Java versions. Every ATOM feed you spit out with this API will be valid. Yes, this puts a great deal of work onto the ATOM boys, but the result is that no user ever gets punished for some bad code, and at the same time programmers like Brent get valid XML every time. Think on it.

Posted on January 14, 2004 05:45 PM | blog | TrackBack

I still don't get all this RSS and ATOM and feeds and stuff. If people would take the time and energy spent making new, complex things and apply it to improving old things, like XHTML, the new things would be unnecessary.

Why have ten different files that contain the same information?

·January 17, 2004 02:52 AM · comment by Brian   -   ∞
  Post a comment

Remember personal info?