In the last attempt to simplify XML, two key requirements were a) compatibility with XML, and b) minimalization. This time, I removed the compatibility requirement and shifted to focus to user-friendly syntax: easier to read and write than XML. First rought cut of the syntax is described informally and in brief below. Please keep in mind that the syntax is incomplete but presented here to promote discussion and exploration.
New SML (Simple Markup Language) syntax is best described showing how an XML fragment example looks like in SML.
XML Version:
<circle x="1.0" y="1.0" r="0.5">
<fill color="#FF0000"/>
<text>Hello</text>
<text>World</text>
</circle>
SML Version:
circle x="1.0" y="1.0"
r="0.5"
fill color="#FF0000"
text "Hello"
text
"World"
Key features are:
- no brackets around element names. Instead, indentations are used to encode hierarchy Python-style.
- one element per line.
- textual data must be quoted.
- attributes are double indented. They may be on the same line as their element for readability. Structured attribute value may be supported.
[Note: I removed assignable content to avoid some confusions.]
Note that SML can be used just as a visual data format, to interactively read and write XML, and not as an data storage or transport format. Additional features I am thinking of adding are:
- triple quotes for multi-line textual data
- C-style character escapes using backslash
- # for comments and others (i.e. PI, namespace, aliases, etc.)
- using line-continuation backslash chracter instead of double indent