Dual syntax for XML languages

XML is successful as a machine processable data interchange format, but it is often too verbose for human use. For this reason, many XML languages permit an alternative more legible non-XML syntax. XSLT stylesheets are often used to convert from the XML syntax to the alternative syntax; however, such transformations are not reversible since no general tool exists to automatically parse the alternative syntax back into XML. We present XSugar, which makes it possible to manage dual syntax for XML languages. An XSugar specification is built around a context-free grammar that unifies the two syntaxes of a language. Given such a specification, the XSugar tool can translate from alternative syntax to XML and vice versa. Moreover, the tool statically checks that the transformations are reversible and that all XML documents generated from the alternative syntax are valid according to a given XML schema.

[1]  Robert Glück,et al.  Principles of Inverse Computation and the Universal Resolving Algorithm , 2002, The Essence of Computation.

[2]  John Boyer Canonical XML Version 1.0 , 2001, RFC.

[3]  Robert E. Gruber,et al.  PADS: Processing Arbitrary Data Streams , 2003 .

[4]  Jeffrey D. Ullman,et al.  Introduction to Automata Theory, Languages and Computation , 1979 .

[5]  David A. Schmidt,et al.  The essence of computation: complexity, analysis, transformation , 2002 .

[6]  David Walker,et al.  PADS/ML: a functional data description language , 2007, POPL '07.

[7]  C. M. Sperberg-McQueen,et al.  Extensible Markup Language (XML) , 1997, World Wide Web J..

[8]  Shinya Kawanaka,et al.  biXid: a bidirectional transformation language for XML , 2006, ICFP '06.

[9]  David Beech,et al.  XML-Schema Part 1: Structures Second Edition , 2004 .

[10]  Zhenjiang Hu,et al.  Bidirectionalising Haxml , 2005 .

[11]  Nils Klarlund,et al.  Document Structure Description 1.0 , 2000 .

[12]  Aske Simon Christensen,et al.  Extending Java for high-level Web service construction , 2002, TOPL.

[13]  Michael I. Schwartzbach,et al.  XML graphs in program analysis , 2007, PEPM '07.

[14]  Christian Kirkegaard,et al.  Static analysis of XML transformations in Java , 2003, IEEE Transactions on Software Engineering.

[15]  Jonathan Robie,et al.  Document Object Model (DOM) Level 2 Specification , 1998 .

[16]  Mark-Jan Nederhof,et al.  Regular Approximation of Context-Free Grammars through Transformation , 2001 .

[17]  Christian Kirkegaard,et al.  Type Checking with XML Schema in XACT , 2005, PLAN-X.

[18]  Arvind Malhotra,et al.  XML Schema Part 2: Datatypes Second Edition , 2004 .

[19]  Claus Brabrand,et al.  Static Validation of Dynamically Generated HTML , 2001 .

[20]  Donald E. Knuth,et al.  On the Translation of Languages from Left to Right , 1965, Inf. Control..

[21]  Aske Simon Christensen,et al.  Static Analysis for Dynamic XML , 2002 .

[22]  Benjamin C. Pierce,et al.  Combinators for bi-directional tree transformations: a linguistic approach to the view update problem , 2005, POPL '05.

[23]  Sean McGrath XML Processing with Python , 2000 .

[24]  Tim Bray,et al.  Presenting Xml , 1997 .

[25]  Robert Giegerich,et al.  Analyzing Ambiguity of Context-Free Grammars , 2007, CIAA.

[26]  Christian Kirkegaard,et al.  Static Analysis of XML Transformations in Java , 2003 .

[27]  C. M. Sperberg-McQueen,et al.  Extensible markup language , 1997 .

[28]  Jay Earley,et al.  An efficient context-free parsing algorithm , 1970, Commun. ACM.

[29]  Bo Leuf,et al.  The Wiki Way: Quick Collaboration on the Web , 2001 .