How would XML mixed content be encoded in mark? That is, if I have <root>text1 <foo/> text2</root> What does that look like in mark? Otherwise, based on a first reading, it looks, syntactically, like it is structurally equivalent to XML except as regards attributes (in that structures within properties in mark could not be translated directly to XML attributes but could be translated to nested elements. That is, there’s semantically no difference between {root prop: { foo: “bar”, baz: “blorg” } } And {root {prop foo: “bar”, baz: “blorg”} } In both cases the label “prop” is associated with the atomic properties foo and baz. (Which brings us back to the eternal “attributes or subelements?” question) But I will observe that, while in XML the difference is very large syntactically, here in mark is quite small, which is interesting. I definitely like having the explicit type label. I will also observe that mark, with attributes restricted to simple values, could be defined as an alternative SGML syntax, as far as I can tell (without actually trying it, who actually remembers SGML syntax declaration syntax any more, or even has tools on hand to validate it?). I’ve been doing work with MarkLogic lately, where you can use JSON instead of XML or explicitly-constructed maps to pass data structures around. I think I would find mark a syntactically-convenient alternative to XML and JSON for that purpose: I find it annoying that JSON does not have mark’s object type label but XML syntax is verbose when you’re just trying to create a data structure that’s not just a set of name-value pairs. But I wouldn’t use mark for existing XML applications where XML is primary human-authored source, for a number of reasons. Cheers, E. -- Eliot Kimber http://contrext.com From: Henry Luo <henry@perpetuatech.net> I am happy to announce the first public beta release of Mark - a simple notation that unifies JSON and XML. Objective Markup Notation, abbreviated as Mark or {mark}, is a new unified notation for both object and markup data. The notation is a superset of what can be represented by JSON, HTML and XML, but overcomes many limitations these popular data formats, yet still having a very clean syntax and simple data model. Mark SampleBelow is a sample Mark object, representing a simple registration form:
Mark Data ModelMark object has a very clean and simple data model. Each Mark object has 3 facets of data:
Mark utilizes a novel feature in _javascript_ that a plain JS object is actually array-like. It can contain both named properties and indexed properties. Mark vs. JSONMark is a superset of JSON. It extends JSON notation with a type-name, and a list of content objects. Comparing to JSON, Mark has the following advantages:
Some disadvantages of Mark, comparing to JSON would be:
Mark vs. XMLComparing to XML, Mark has the following advantages:
What do you think?With an unified notation and data model, one set of tools (parser, selector, query, validator, transformer, ...) can be used to process data previously stored in JSON, HTML or XML. Do you thing Mark is a better generic data format than JSON or XML? Do you think it is worth all the effort to migrate to this new notation? ... Looking forward to hear your feedback! Regards Henry |