ConciseXML and XML 1.0
XML was derived from SGML and contains constructs from a document-centricnot data-centricworld. The XML 1.0 syntax has no standard representation for objects with fields. Field key, data, and type information might be encoded in a dozen different ways in a dozen different standards. A substantial number of developers find XML 1.0 syntax verbose and cumbersome and avoid using it for these reasons. ConciseXML is efficient and readable without the use of special tools.
ConciseXML can be as concise as the comma separated value (CSV) format for data. When used for programming, ConciseXML is as concise as Java or C++ syntax.
ConciseXML has one consistent representation for encoding data: it uses attributes for fields. XML 1.0 specifies that attributes must be quoted strings, but ConciseXML allows the value of a field to be any object, not just a string. The key of a field can also be any object, not just a string. This simple extension significantly reduces the ambiguity of XML 1.0 documents and makes XML much more suited for representing data and logic.
ConciseXML is a superset of XML 1.0 and is both forward and backward compatible with XML 1.0. ConciseXML supports both the XML 1.0 form as well as a concise form. ConciseXML supports three syntactic extensions to XML 1.0 that reduce the verbosity of XML 1.0 (see Sidebar: ConciseXML Makes Eight Extensions to XML 1.0).
First, ConciseXML permits the closing tag name to be omitted. The closing tag name is redundant because a machine reading the XML can simply match opening tags with closing tags. Requiring the ending tag name encourages developers to choose short, abbreviated tag names. When calling a method in a normal programming language, you don't expect to type the method name twice:
XML 1.0: <textarea>hi</textarea>
An optional closing tag name is actually required for Water because of its dynamism. In some cases, the object of the call is calculated during runtime and therefore is not known when writing the code:
<if> some_text.<more 30/> hypertext.TEXTAREA
Second, ConciseXML supports by-position arguments. This means the attribute key can be omitted. When calling a method in a typical programming language, you do not expect to name the arguments in a call. This eliminates ambiguity because the definition of the method defines the exact ordering of arguments. In this respect, ConciseXML supports the calling convention of popular programming languages:
XML 1.0: <person first="Mike" last="Plusch"/>
ConciseXML: <person "Mike" "Plusch"/>
ConciseXML also eliminates the need for character entities and replaces them with a standard object reference. See the www.waterlanguage.org site for more details.
For every ConciseXML extension to XML 1.0, there is a corresponding representation in the XML 1.0 syntax. A single file can include both ConciseXML and XML 1.0 forms. Many different XML 1.0 representations for ConciseXML are possible, but ConciseXML uses a simple representation where attributes that have non-string keys or values are put within an attributes element. The following two examples create the same object:
<attributes><item name="bread"/><item name="milk"/></attributes>
<list <item name="bread"/> <item name="milk"/> />