Re: [xml-dev] Should XML applications follow Postel’s Law?

From
John Cowan <>
To
Rick Jelliffe <>
Date
2018-04-20T02:13:57Z
ID
<CABzTEQAy6sWg85STGt0GHwJ5w8fnozMO=>
Thread
Re: [xml-dev] Should XML applications follow Postel’s Law?


On Thu, Apr 12, 2018 at 8:34 PM, Rick Jelliffe <[email protected]> wrote:

So this only relates to optional parts of a spec. In XML there are only three optional things: version, standalone, character encoding.

While I agree with this post, there is rather more optionality in XML than that.  Consider the following Postel-like suggestions:

Make sure that namespaces and prefixes are mapped 1:1 (sane documents, in Joe English's sense)

If possible, put all namespace declarations in the root element (namespace-normal documents).

Think twice before using namespaces at all.

If possible, keep Unicode noncharacters and control characters out of character content and attribute values.

Use hex (not decimal) character references only if required by non-Unicode-aware editing tools.  Do not use &#xD;.

Minimize the use of PIs.

Don't use CDATA sections, except in documents that are about markup.

Use the five named escapes, not their hex equivalents.

Always escape > characters.

-- 
John Cowan          http://vrici.lojban.org/~cowan        [email protected]
The Penguin shall hunt and devour all that is crufty, gnarly and
bogacious; all code which wriggles like spaghetti, or is infested with
blighting creatures, or is bound by grave and perilous Licences shall it
capture.  And in capturing shall it replicate, and in replicating shall
it document, and in documentation shall it bring freedom, serenity and
most cool froodiness to the earth and all who code therein.  --Gospel of Tux