[prev in list] [next in list] [prev in thread] [next in thread]
List: xml-dev
Subject: Re: [xml-dev] Many different syntaxes in XML - is that good language design?
From: Pete Cordell <pete++xmldev () codalogic ! com>
Date: 2022-03-07 15:52:46
Message-ID: 6bacc2f4-51c3-29df-ceef-3829ce57be68 () codalogic ! com
[Download RAW message or body]
On 07/03/2022 14:20, Norman Gray wrote:
> 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
I'm surprised I hadn't spotted this before!!! So in essence:
- "<" means escape from text flow
- If "<" is followed by a "!" it is a standard defined "meta" data item
/ directive.
- If "<" is followed by "?" it is user defined meta data / directive.
- If "<" is followed by a letter then it is user defined text markup.
&??? allows you to include "<" in text and insert an actual "&".
Viewed like that it seems a fairly minimal and efficient syntax.
(It does make me wonder why the CDATA section 'directive' wasn't just
<!CDATA[...]>. Even more curious, given all the SGML things that got
dropped, is how it got included in XML. It creates just as many
problems as it solves.)
Cheers,
Pete.
--
---------------------------------------------------------------------
Pete Cordell
Codalogic Ltd
Read & write XML in C++, http://www.xml2cpp.com
---------------------------------------------------------------------
_______________________________________________________________________
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: xml-dev-unsubscribe@lists.xml.org
subscribe: xml-dev-subscribe@lists.xml.org
List archive: http://lists.xml.org/archives/xml-dev/
List Guidelines: http://www.oasis-open.org/maillists/guidelines.php
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic