Re: [xml-dev] The illusion of simplicity and low cost in data design and computing

From
Liam R. E. Quin <>
To
Rick Jelliffe <>, xml-dev <>
Date
2022-08-15T03:48:19Z
ID
<>
Thread
Re: [xml-dev] The illusion of simplicity and low cost in data design and computing
On Mon, 2022-08-15 at 11:49 +1000, Rick Jelliffe wrote:
> I don't recall a way to say that some element's content uses a
> notation, in XML. 

[[
A NOTATION attribute identifies a notation, declared in the DTD with
associated system and/or public identifiers, to be used in interpreting
the element to which the attribute is attached.
]]


Notation also applies to external non-parsed entities, but in a Web
environment it's the server that tells the parser, via HTTP headers,
the format of the resource, and not the document author. So XML's NDATA
entities are not a good fit for the Web.

We don't really have an equivalent of Markdown-style
```sh
#! /bin/sh
echo goodbye && exit 1
```

where the "sh" on the first line identifies (poorly) the format, e.g.
for the purpose of syntax highlighting, but a notation attribute is
close. The main difference is that markdown processing is suspended
between the ``` marks, whereas an XML document must be well-formed even
if elements declared as having an associated notation were not so
declared. E.g. you can't put a stray & in element content even if it's
in a declared non-XML notation.

In retrospect if we'd done this better, we could have largely dispensed
with CDATA sections --
<example format="xml-as-text">
   <p>should be able to put anything here except an example end-tag,
   & not get an error</p>
</example>

But we didn't...

liam


-- 
Liam Quin, https://www.delightfulcomputing.com/
Available for XML/Document/Information Architecture/XSLT/
XSL/XQuery/Web/Text Processing/A11Y training, work & consulting.
Barefoot Web-slave, antique illustrations:  http://www.fromoldbooks.org