4 ms·
XML is a serialization format. It's trivial to mechanically separate the markup from the content when reading and to merge them back when writing. (It should ev
by Mikhail_Edoshin 6y ago
XML is a serialization format. It's trivial to mechanically separate the markup from the content when reading and to merge them back when writing. (It should even be the preferred approach for many usage scenarios as it's rather efficient.) The description implies content and markup are physically separate; it can be done, but why? Although there is at least one upside: the same text can have multiple different markups attached (e.g. syntax and revision control or syntax and extra highlighting).
- simonh 6y agoWhy is you want revision control of both the text and the syntax markup? This seems incredibly brittle.
- Mikhail_Edoshin 6y agoNo, I meant that the same text may have two or three kinds of associated markup runs: syntax, revision control, and highlighting so that we can nicely publish a snippet.
- simonh 6y agoRight, so revision control is one of the types of markup of the text. But what happens when you want revision control of some of the other types of markup as well as for the text. Or when you want highlighting of different revisions of the text.
- Mikhail_Edoshin 6y agoRevision control is not exactly markup. It is metadata and so is the syntax information. It's derived from text or from something else (comparison of two text by VCS), but not added there manually. Markup is normally metadata added manually, although a markup language can be used for both manual and automatic metadata. So we have a source and some associated metadata that is crafted manually. I don't see this to differ much from other cases when we need to manually sync two distinct files (e.g. C source and header files), so I don't quite understand the issue, I guess.
- simonh 6y agoI suppose what I'm thinking is that is many cases markup is not metadata. It's semantic and part of the meaning of the text in the same way and to the same extent that punctuation is markup. Nobody would put punctuation in a metadata file. But why not? It's markup in exactly the same way that a lot of HTML is. In fact formats such as Markdown can be considered extensions of punctuation just as much as they are simplifications of markup. I remember reading a discussion of word processor document formats back in the 90s, concerning the representation of layout and embedded images and tables. One participant was saying that conceptually the correct way to treat such inclusions is as a character. It's part of the text, not some external thing imposed on the document from outside. For a page layout system such as DTP you might make a different choice because the focus is different, but for word processing I thought this was a very insightful point. A lot of markup is part of the data as well and best treated as such.
- Mikhail_Edoshin 6y agoI agree, all markup added manually is same as content. If it cannot be derived automatically from the rest of the content, then it is on the same level as content and what we call "markup" becomes simply a special notation to describe these parts of the whole content. A drawing, a formula, a form, and so on. Or even punctuation; it may be important to tell the difference between the period that ends a sentence vs an abbreviated initial :) I myself don't think it's worth to actually keep content and markup in separate files, so for me the only possible use case was conflicting markup, i.e. markup that exceeds the limitations of our tools, something like two overlapping tags in XML. Yet even this case doesn't require actual physical separation; it can be solved with a different notation or maybe a different tool (like SGML, which, I believe, supported overlapping tags).