=encoding utf8 =head1 Qantor (“Qantor Ain't No Tex/Troff - Oh Really!”) Specification =head2 Motivation - what is Qantor? So what is Qantor? In a nutshell Qantor is a B<generic and strict XML generator> primarily intended for notating any XML-based text grammar. Here are a few more things that Qantor aims to be, and won't be. =head3 Qantor is a generic XML generator Qantor should be able to generate any arbitrary XML document (or even sever interleaved documents), with support for most modern XML non-grammar standards, such as XML namespaces or XLink. Furthermore, it is not limited to a specific grammar - it can generate XHTML, DocBook/XML, SVG, WSDL, Atom, TEI, or whatever. =head3 Qantor is strict. Upon even a small syntax error, Qantor's syntax will generate an exception with the exact place where the error occured, and will refuse to process the document further (or possibly proceed while looking for other errors, but still will not output a result). This is done to maintain a good ability for machines (and humans) to parse, process and analyze the code. =head3 Qantor is not a lightweight markup language While one can use Qantor to generate XHTML and DocBook/XML 5, it can be used for more than that, and its syntax will not be constrained by such problems. Furthermore, its syntax will be more strict and regular than most lightweight markup languages and writing it should be less error-prone and more enjoyable for the clueful user. (And there will be a provision for easily providing GUI editors for some applications/grammars of Qantor markup, for people who still find editing plaintext markup intimidating.) =head3 Qantor is not a typesetting system Qantor’s primary aim is to allow for quick, consistent, and powerful generation of XML documents representing rich and/or semantic text (because for non-textual or text-involving data, one should normally prefer such formats as L<http://en.wikipedia.org/wiki/JSON> or L<http://en.wikipedia.org/wiki/YAML>) such as DocBook 5/XML or TEI (or more specialised grammars such as XHTML or L<http://www.shlomifish.org/open-source/projects/XML-Grammar/> ). However, after it is done it leaves the actual translation into well-formated and letter-perfect text to the lower layers, who may opt to apply CSS transformations, use XSL-FO, or generate LaTeX or Troff from it. =head3 Qantor may or may not be Turing complete Qantor's syntax will be regular and predictble (and very strict), but we cannot rule out that once enough features are added, as needed, it will become Turing complete, by accident. Many similar efforts in the past have ended up being Turing-complete: TeX, Troff, CSS 3.0, Haskell's type system, C++'s syntax, etc. By virtue of the L<http://en.wikipedia.org/wiki/Halting_problem>, the general case for a Turing program written in them, is impossible for a computer to reason about, and draw conclusions from. However, some analyses and transformations of programs written in one, can often still be performed. Furthermore, we expect that human editors will be able to diagnose and fix problems with misbehaving Qantor documents, or to judge overly complicated ones as too obfuscated, and reject them after the fact. We do not intend to make Qantor Turing-complete on purpose, just to note that the sky won't fall if it happens. Furthermore, the MediaWiki syntax, with its templates, was demonstrated to be Turing-complete anyway, and part of Qantor's ambition is to be a viable alternative (with a gradul transition path) for MediaWiki-based wikis in the future. =head3 Conclusion I hope I did not bore you too much with the introduction and motivation (see what Mark Jason Dominus has to say about it in his Conference Presentation Judo - L<http://perl.plover.com/yak/presentation/> ). Now I'll get to the actual syntax specification.