Re: Many different syntaxes in XML - is that good language design?

Norman Gray <[email protected]>
Newsgroups gmane.text.xml.devel
Message-ID <[email protected]>
Roger, hello.

On 7 Mar 2022, at 12:14, Roger L Costello wrote:

> Phew! That is a lot of different syntaxes.

As Peter mentioned, those aren't different 'syntaxes'.  There's just one syntax being described here -- the document syntax -- which has a relatively small number of lexical elements.  Thus 'the syntax' is the set of rules about how all of those lexical elements may be combined.  And as Shaun mentions, XML is remarkable for being an embedded syntax (embedded within the flow of document text, that is), which has only two characters which shift to 'markup' (TeX, which is doing the same thing in a way, has 16 different categories of character).

A possibly interesting tangent: there are fewer lexical elements here than might be obvious, depending on your point of view.  One of these is '<!', which is what SGML described as 'markup declaration open', meaning a bit of markup that isn't an element, but is instead somewhat 'meta'.  The following 'markup declaration' could be 'DOCTYPE' or '[CDATA[' (and a couple more).  Entertainingly, it could also be empty: '<!>', though that empty markup declaration could contain commented text: the comment characters in SGML were '--' as open and close characters, which could appear anywhere; thus you could, I recall have

  <element -- here's an comment -- att='val'/>,

Also '<!>' could have comments between a pair of '--' strings: <!-- comment -->.  XML says that 'comments open with '<!--' and close with '-->', but this is where those odd strings come from.

Best wishes,

Norman


-- 
Norman Gray  :  https://nxg.me.uk
SUPA School of Physics and Astronomy, University of Glasgow, UK

_______________________________________________________________________

XML-DEV is a publicly archived, unmoderated list hosted by OASIS
to support XML implementation and development. To minimize
spam in the archives, you must subscribe before posting.

[Un]Subscribe/change address: http://www.oasis-open.org/mlmanage/
Or unsubscribe: [email protected]
subscribe: [email protected]
List archive: http://lists.xml.org/archives/xml-dev/
List Guidelines: http://www.oasis-open.org/maillists/guidelines.php
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.