is XML Syntax Regular?

Even XML, whose syntax is more regular than lisp, cannot escape irregularities.

Here's a sample valid XML, from ATOM webfeed.

<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:base="http://xahlee.info/comp/">

  <title>…</title>
  <subtitle>…</subtitle>
  <link rel="self" href="blog.xml"/>
  <link rel="alternate" href="blog.html"/>
  <updated>…</updated>
  <author>
    <name>…</name>
    <uri>…</uri>
  </author>
  <id>…</id>
  <icon>…</icon>
  <rights>…</rights>

  <entry>
    <title>…</title>
    <id>…</id>
    <updated>…</updated>
    <summary>…</summary>
    <content type="xhtml">
      <div xmlns="http://www.w3.org/1999/xhtml">
        <p><a href="…">…</a></p>
        <p>…</p>
        <p>…</p>
      </div>
    </content>
    <link rel="alternate" href="…"/>
  </entry>

</feed>

Can you spot the syntax irregularity?

for moar, see Programing Language Design: Syntax Sugar Problem: Irregularity vs Convenience

Popular posts from this blog

Browser User Agent Strings 2012

11 Years of Writing About Emacs

does md5 creates more randomness?