Vitavonni

Thu, 18 Jan 2007

More on XML

Gunnar, first of all, let me point out that repeating the closing tag makes the format more robust. If the parser encounters a non-matching closing tag it knows that something isn't right. Thats a feature, not a bug.

IIRC SGML had shortened closing tags (</>) and closing tags were partially optional; if the parser encountered a closing tag it would assume all other tags closed up to the previous matching tag.

I guess some people who used SGML and were involved with XML had made the experience that this was a bad idea. It makes parsing harder and the file format more likely to break.

If XML would only be written by perfect tools, we wouldn't need the verbose closing tags. We could probably use some binary syntax like "\1tagname\0\2contents\0". Parsing would be fast and easy. Or something along

tag { "string contents" tag {} }
(which I like a lot). Or S-Expressions. But it is a strength of XML that you can detect certain common errors such as incorrectly nested tags: XML data is generated by broken tools all the time, so we need a syntax which allows us to detect such errors.

As for my RSS feed: the links are correct. The tool you are using mishandles the guid tag, which is just a unique identifier; the sole responsibility of my blog is to make them unique. Many tools use a link for the guid, but that is not required by the spec. In fact my blog is quite verbose about not using the full URL there: isPermaLink="false". Instead it provides the "link" element. Look at the source of my RSS, no repeated "en/" in there.

Planet is broken here, and your reader:

  • Your reader is broken, because it assumes that the guid tag is a link. It's a unique identifier, a string, which often is a URL, but can be arbitrary. It should use the link element instead (which IS the correct URL)
  • Planet is broken, because of the way it constructs the guid field from my blog (granted, it does need a way to do that), especially losing the isPermaLink="false" attribute.

[category: /en/linux | Permalink]
Menu
[planet.debian]
[planet.xmlhack]
[planet SELinux]
[munichblogs]
[email]
[RSS 2 feed]
[English RSS 2]
Categories
< January 2007 >
SuMoTuWeThFrSa
  1 2 3 4 5 6
7 8 910111213
14151617181920
21222324252627
28293031   
Archives
2010-Jul
2010-Jun
2010-May
2010-Apr
2010-Mar
2010-Feb
2010-Jan
2009-Dec
2009-Nov
2009-Oct
2009-Sep
2009-Aug
2009-Jul
2009-Jun
2009-May
2009-Apr
2009-Mar
2009-Feb
2009-Jan
2008-Dec
2008-Nov
2008-Oct
2008-Sep
2008-Aug
2008-Jul
2008-May
2008-Apr
2008-Mar
2008-Feb
2008-Jan
2007-Dec
2007-Nov
2007-Oct
2007-Sep
2007-Aug
2007-Jul
2007-Jun
2007-May
2007-Apr
2007-Mar
2007-Feb
2007-Jan
2006-Dec
2006-Nov
2006-Oct
2006-Sep
2006-Aug
2006-Jul
2006-Jun
2006-May
2006-Apr
2006-Mar
2006-Feb
2006-Jan
2005-Dec
2005-Nov
2005-Oct
2005-Sep
2005-Aug
2005-Jul
2005-Jun
2005-May
2005-Apr
2005-Mar
2005-Feb
2005-Jan
2004-Dec
2004-Nov
2004-Oct
2004-Sep
2004-Aug
2004-Jul
Other links:
Swing and the City - Lindy Hop in Munich