Xsugar: Dual Syntax for XML LanguagesTōkyō Daigaku [ July 15, 2005 ] / 401 xsugar Dual Syntax for XML Languages Claus Brabrand Anders Møller Michael Schwartzbach.

Slides:



Advertisements
Similar presentations
[ 1 ] Claus Brabrand, ITU BANANA ALGEBRA DIKU, KU, Denmark May 11, 2010 Banana Algebra: Jacob Andersen [ ] Aarhus University Claus Brabrand.
Advertisements

[ 1 ] Claus Brabrand, ITU BANANA ALGEBRA March 28, 2009 ETAPS/LDTA, York Banana Algebra: Jacob Andersen [ ] Aarhus University Claus Brabrand.
Lecture # 8 Chapter # 4: Syntax Analysis. Practice Context Free Grammars a) CFG generating alternating sequence of 0’s and 1’s b) CFG in which no consecutive.
1 Web Data Management XML Schema. 2 In this lecture XML Schemas Elements v. Types Regular expressions Expressive power Resources W3C Draft:
“Approximating Context-Free Grammar Ambiguity”November 2, Approximating Context-Free Grammar Ambiguity Claus Brabrand BRICS, Department.
ISBN Chapter 3 Describing Syntax and Semantics.
176 Formal Languages and Applications: We know that Pascal programming language is defined in terms of a CFG. All the other programming languages are context-free.
9/27/2006Prof. Hilfinger, Lecture 141 Syntax-Directed Translation Lecture 14 (adapted from slides by R. Bodik)
ModelicaXML A Modelica XML representation with Applications Adrian Pop, Peter Fritzson Programming Environments Laboratory Linköping University.
Chapter 3 Describing Syntax and Semantics Sections 1-3.
Context-Free Grammars Lecture 7
CS 330 Programming Languages 09 / 18 / 2007 Instructor: Michael Eckmann.
Chapter 3 Describing Syntax and Semantics Sections 1-3.
Syntax Analysis Mooly Sagiv html:// Textbook:Modern Compiler Design Chapter 2.2 (Partial) Hashlama 11:00-14:00.
Static Validation of Dynamically Generated XML Documents A survey on a series of papers by the BRICS research group at the University of Aarhus, Denmark.
1 Foundations of Software Design Lecture 23: Finite Automata and Context-Free Grammars Marti Hearst Fall 2002.
Chapter 3 Describing Syntax and Semantics Sections 1-3.
Syntax Analysis Mooly Sagiv Textbook:Modern Compiler Design Chapter 2.2 (Partial)
Dr. Muhammed Al-Mulhem 1ICS ICS 535 Design and Implementation of Programming Languages Part 1 Fundamentals (Chapter 4) Compilers and Syntax.
XML –Query Languages, Extracting from Relational Databases ADVANCED DATABASES Khawaja Mohiuddin Assistant Professor Department of Computer Sciences Bahria.
XML Technologies and Applications Rajshekhar Sunderraman Department of Computer Science Georgia State University Atlanta, GA 30302
Winter 2003/4Pls – syntax – Catriel Beeri1 SYNTAX Syntax: form, structure The syntax of a pl: The set of its well-formed programs The rules that define.
A PRIL 05, 2006 B IELEFELD, G ERMANY "A NALYZING A MBIGUITY OF C ONTEXT-FREE G RAMMARS " Analyzing Ambiguity of Context-Free Grammars BRICS, Department.
Compilation 2007 Context-Free Languages Parsers and Scanners Michael I. Schwartzbach BRICS, University of Aarhus.
4/20/2017.
10/14/2001 Coping with Semantics in XML Document Management Thomas Kudrass Leipzig University of Applied Sciences Department of Computer Science and Mathematics.
1 Syntax and Semantics The Purpose of Syntax Problem of Describing Syntax Formal Methods of Describing Syntax Derivations and Parse Trees Sebesta Chapter.
1 Introduction to Parsing Lecture 5. 2 Outline Regular languages revisited Parser overview Context-free grammars (CFG’s) Derivations.
Syntax & Semantic Introduction Organization of Language Description Abstract Syntax Formal Syntax The Way of Writing Grammars Formal Semantic.
Syntax Directed Definitions Synthesized Attributes
XML Anisha K J Jerrin Thomas. Outline  Introduction  Structure of an XML Page  Well-formed & Valid XML Documents  DTD – Elements, Attributes, Entities.
CS 2104 Prog. Lang. Concepts Dr. Abhik Roychoudhury School of Computing Introduction.
Chapter 10: Compilers and Language Translation Invitation to Computer Science, Java Version, Third Edition.
CS 326 Programming Languages, Concepts and Implementation Instructor: Mircea Nicolescu Lecture 2.
COMP Parsing 2 of 4 Lecture 22. How do we write programs to do this? The process of getting from the input string to the parse tree consists of.
1 Chapter 3 Describing Syntax and Semantics. 3.1 Introduction Providing a concise yet understandable description of a programming language is difficult.
Lecture 11 XSL Transformations (part 1: Introduction)
CS Describing Syntax CS 3360 Spring 2012 Sec Adapted from Addison Wesley’s lecture notes (Copyright © 2004 Pearson Addison Wesley)
Lesson 3 CDT301 – Compiler Theory, Spring 2011 Teacher: Linus Källberg.
C H A P T E R TWO Syntax and Semantic.
ISBN Chapter 3 Describing Syntax and Semantics.
TextBook Concepts of Programming Languages, Robert W. Sebesta, (10th edition), Addison-Wesley Publishing Company CSCI18 - Concepts of Programming languages.
1 Syntax In Text: Chapter 3. 2 Chapter 3: Syntax and Semantics Outline Syntax: Recognizer vs. generator BNF EBNF.
作者 : 陳鍾誠 單位 : 金門技術學院資管系 URL : 日期 : 2016/6/4 程式語言的語法 Grammar.
CS 157B: Database Management Systems II February 11 Class Meeting Department of Computer Science San Jose State University Spring 2013 Instructor: Ron.
Context Free Grammars CFGs –Add recursion to regular expressions Nested constructions –Notation expression  identifier | number | - expression | ( expression.
CS412/413 Introduction to Compilers and Translators Spring ’99 Lecture 3: Introduction to Syntactic Analysis.
ISBN Chapter 3 Describing Syntax and Semantics.
Compiler Introduction 1 Kavita Patel. Outlines 2  1.1 What Do Compilers Do?  1.2 The Structure of a Compiler  1.3 Compilation Process  1.4 Phases.
1Computer Sciences Department. Book: INTRODUCTION TO THE THEORY OF COMPUTATION, SECOND EDITION, by: MICHAEL SIPSER Reference 3Computer Sciences Department.
Syntax Analysis - Parsing Compiler Design Lecture (01/28/98) Computer Science Rensselaer Polytechnic.
Syntax and Semantics Form and Meaning of Programming Languages Copyright © by Curt Hill.
Syntax Analysis – Part I EECS 483 – Lecture 4 University of Michigan Monday, September 17, 2006.
CSC312 Automata Theory Lecture # 26 Chapter # 12 by Cohen Context Free Grammars.
Concepts and Realization of a Diagram Editor Generator Based on Hypergraph Transformation Author: Mark Minas Presenter: Song Gu.
1 Introduction to Parsing. 2 Outline l Regular languages revisited l Parser overview Context-free grammars (CFG ’ s) l Derivations.
CSC 4181 Compiler Construction
C H A P T E R T W O Syntax and Semantic. 2 Introduction Who must use language definitions? Other language designers Implementors Programmers (the users.
Jackson, Web Technologies: A Computer Science Perspective, © 2007 Prentice-Hall, Inc. All rights reserved Chapter 7 Representing Web Data:
Copyright © 2006 Addison-Wesley. All rights reserved.1-1 ICS 410: Programming Languages Chapter 3 : Describing Syntax and Semantics Syntax.
XML Notes taken from w3schools. What is XML? XML stands for EXtensible Markup Language. XML was designed to store and transport data. XML was designed.
Syntax Analysis By Noor Dhia Syntax analysis:- Syntax analysis or parsing is the most important phase of a compiler. The syntax analyzer considers.
Compiler Design BMZ 1 Chapter4: Syntax Analysis. Compiler Design BMZ 2 Syntax Analysis Source Program Target Program Semantic Analyser Intermediate Code.
XML: Extensible Markup Language
Chapter 3 – Describing Syntax
Unit 4 Representing Web Data: XML
XML in Web Technologies
Chapter 7 Representing Web Data: XML
XML Problems and Solutions
Chapter 10: Compilers and Language Translation
Presentation transcript:

xsugar: Dual Syntax for XML LanguagesTōkyō Daigaku [ July 15, 2005 ] / 401 xsugar Dual Syntax for XML Languages Claus Brabrand Anders Møller Michael Schwartzbach BRICS, Department of Computer Science University of Aarhus, Denmark

xsugar: Dual Syntax for XML LanguagesTōkyō Daigaku [ July 15, 2005 ] / 402 // Abstract “xsugar: Reversible Stylesheets” XSLT stylesheets may be used to provide an alternative and more legible syntax for XML documents. However, such transformations are not reversible since no tool exists to automatically parse the alternative syntax back into XML. We present xsugar, which is a reversible stylesheet language for XML. An xsugar specification is built around a context-free grammar for the alternative syntax and gives a template-based translation into XML. The xsugar tool can then provide three services: 1) a static guarantee that all XML documents generated from alternative syntax are valid according to a given XML schema; 2) a translation from alternative syntax into XML; and 3) a reverse translation from XML into alternative syntax (provided certain injectivity requirements are satisfied). The well-formedness of both translations are statically checked. Thus, xsugar is useful for providing an XML syntax for an existing language or for providing an alternative syntax for an existing XML language. This is joint on-going work with Anders Møller and Michael I. Schwartzbach. XSLT stylesheets may be used to provide an alternative and more legible syntax for XML documents. However, such transformations are not reversible since no tool exists to automatically parse the alternative syntax back into XML. We present xsugar, which is a reversible stylesheet language for XML. An xsugar specification is built around a context-free grammar for the alternative syntax and gives a template-based translation into XML. The xsugar tool can then provide three services: 1) a static guarantee that all XML documents generated from alternative syntax are valid according to a given XML schema; 2) a translation from alternative syntax into XML; and 3) a reverse translation from XML into alternative syntax (provided certain injectivity requirements are satisfied). The well-formedness of both translations are statically checked. Thus, xsugar is useful for providing an XML syntax for an existing language or for providing an alternative syntax for an existing XML language. This is joint on-going work with Anders Møller and Michael I. Schwartzbach.

xsugar: Dual Syntax for XML LanguagesTōkyō Daigaku [ July 15, 2005 ] / 403 // Outline (3 parts) Introduction xsugar Syntax and Semantics Unifying Syntax Tree Validation Analysis DTDs & Summary Graphs Schema Languages Reversibility Analysis Info Preservation Unambiguity Teleportation More Examples Related & Future Work Assessment Conclusion Introduction (xsugar) Static Analyses Assessment 1 2 3

xsugar: Dual Syntax for XML LanguagesTōkyō Daigaku [ July 15, 2005 ] / 404 Validation Analysis DTDs & Summary Graphs Schema Languages // Part 1: Introduction Introduction xsugar Syntax and Semantics Unifying Syntax Tree Reversibility Analysis Info Preservation Unambiguity Teleportation More Examples Related & Future Work Assessment Conclusion Introduction (xsugar) Static Analyses Assessment 1 2 3

xsugar: Dual Syntax for XML LanguagesTōkyō Daigaku [ July 15, 2005 ] / 405 Relax NG: // Motivation Relax RNGRelax RNC correspondence ? maintenance ? reversibility ? validity (XML) ? termination ? RNC-to-RNG: Python script (1,478 lines) RNG-to-RNC: XSLT stylesheet (894 lines) Dynamic issues :

xsugar: Dual Syntax for XML LanguagesTōkyō Daigaku [ July 15, 2005 ] / 406 XQuery: // Motivation (cont’d) XQueryXXQuery correspondence ? maintenance ? reversibility ? validity (XML) ? termination ? XQuery-to-XQueryX: Non-existent...! XQueryX-to-XQuery: XSLT stylesheet (845 lines) Dynamic issues :

xsugar: Dual Syntax for XML LanguagesTōkyō Daigaku [ July 15, 2005 ] / 407 One stylesheet produces: // xsugar XL correspondence ! maintenance ! reversibility ! validity (XML) ! termination ! Static guarantees: L2X: Transformation: L  X X2L: Reverse transformation: X  L xsugar s : L  X

xsugar: Dual Syntax for XML LanguagesTōkyō Daigaku [ July 15, 2005 ] / 408 // Example: Transformation… Claus Brabrand Claus Brabrand Name = {... } = {... } Id = { [0-9]+ } student : [Name n] ( [ e] ) [Id id] \n = { } [Name n][ e][Id id] s: L  X parsing unparsing parsing unparsing transformation x: l :

xsugar: Dual Syntax for XML LanguagesTōkyō Daigaku [ July 15, 2005 ] / 409 // …and Reverse Transformation Claus Brabrand Claus Brabrand Name = {... } = {... } Id = { [0-9]+ } student : [Name n] ( [ e] ) [Id id] \n = { } s: L  X unparsing parsing unparsing parsing reverse transformation x: l : [Id id][Name n][ e]

xsugar: Dual Syntax for XML LanguagesTōkyō Daigaku [ July 15, 2005 ] / 4010 Nfinite set of unifying nonterminals  finite alphabet of terminals s  Nstart unifying nonterminal Ufinite set of unification names  : N  P(E*  E*),unifying production function, E = (N  U)   // Unifying Grammar student : [Name n] ( [ e] ) [Id id] \n = { } G =  N, , s, U,   unification: 2 right-hand sides

xsugar: Dual Syntax for XML LanguagesTōkyō Daigaku [ July 15, 2005 ] / 4011 // Regular Nonterminal Shorthand Regular expressions (convenient short-hand) for regular nonterminals (w/ identity unification): student : [Name n] ( [ e] ) [Id id] \n = { } Id = { [0-9]+ } id : [num n] [id i] = { } : [num n] = { } num : 0 = { 0 } … : 9 = { 9 } desugaring

xsugar: Dual Syntax for XML LanguagesTōkyō Daigaku [ July 15, 2005 ] / 4012 // (A)symmetric Unification Unification is symmetric: Grammar for both L and X However ( XML-induced asymmetry ): X (XML) contains lots of structure  typically impervious to grammatical structure Thus, one can “think of G as grammar for L” Asymmetry reflected syntactically:  : N  P(E*  E*) unification: 2 right-hand sides student : [Name n] ( [ e] ) [Id id] \n = { }

xsugar: Dual Syntax for XML LanguagesTōkyō Daigaku [ July 15, 2005 ] / 4013 // Syntactic Constituents (L) L:L: ConstructionName UST foo token [] [N a] nonterminal [a  ] [N] ignoreable [] Name = { [^(\n]+ } = { [^,) ]+ } Id = { [0-9]+ } student : [Name n] ( [ e] ) [Id id] \n = { }

xsugar: Dual Syntax for XML LanguagesTōkyō Daigaku [ July 15, 2005 ] / 4014 // Syntactic Constituents (X) X:X: ConstructionName UST ‘ ’ (XML) whitespace [] foo text (“PC data”) [] … element (w/ attributes) … gap [a  ] …</… attribute gap Name = { [^(\n]+ } = { [^,) ]+ } Id = { [0-9]+ } student : [Name n] ( [ e] ) [Id id] \n = { }

xsugar: Dual Syntax for XML LanguagesTōkyō Daigaku [ July 15, 2005 ] / 4015 AST L (ordered tree): AST X (partially ordered): // AST L and AST X [id] [n] Claus Brabrand student prod: #1 student prod #1 [e] student : [Name n] ( [ e] ) [Id id] \n = { } [e] [n] Claus Brabrand Attr [id] [] [ ] } {,,,

xsugar: Dual Syntax for XML LanguagesTōkyō Daigaku [ July 15, 2005 ] / 4016 Unifying Syntax Tree (UST) UST (L/X) (unordered tree): // UST (“Unifying Syntax Tree”) student : [Name n] ( [ e] ) [Id id] \n = { } [n] Claus Brabrand student prod: #1 [e] [id] {},,

xsugar: Dual Syntax for XML LanguagesTōkyō Daigaku [ July 15, 2005 ] / 4017 Reversible ? (i.e.  ): Parsing / Unparsing (i.e.  ): Grammar Ambiguity ? Transformation (i.e.  ): Information Preservation ? // “The Big Picture” UST AST L / ~ L AST X / ~ XML... transformation LX L  X Ordered tree Unordered tree Partially Ordered Legend: Canonical: l  L Canonical: x  X 1-1 un-/parsing transformation un-/parsing 1-1/~ L ? 1-1/~ XML ? 1-1?

xsugar: Dual Syntax for XML LanguagesTōkyō Daigaku [ July 15, 2005 ] / 4018 Validation Analysis DTDs & Summary Graphs Schema Languages // Part 1: Introduction Introduction xsugar Syntax and Semantics Unifying Syntax Tree Reversibility Analysis Info Preservation Unambiguity Teleportation More Examples Related & Future Work Assessment Conclusion Introduction (xsugar) Static Analyses Assessment 1 2 3

xsugar: Dual Syntax for XML LanguagesTōkyō Daigaku [ July 15, 2005 ] / 4019 // Part 2: Static Analyses Introduction xsugar Syntax and Semantics Unifying Syntax Tree Validation Analysis DTDs & Summary Graphs Schema Languages Reversibility Analysis Grammar Unambiguity Information Preservation Teleportation More Examples Related & Future Work Assessment Conclusion Introduction (xsugar) Static Analyses Assessment 1 2 3

xsugar: Dual Syntax for XML LanguagesTōkyō Daigaku [ July 15, 2005 ] / 4020 // Motivating Example (Ex. cont’d) Anders Moeller Anders Moeller Name = { [^(\n]+ } = { [^,) ]+ } Id = { [0-9]+ } student : [Name n] ( [ s es] ) [Id id] \n = { } s : [ e] = { } : [ e], [ s es] = { } 

xsugar: Dual Syntax for XML LanguagesTōkyō Daigaku [ July 15, 2005 ] / 4021 // Motivating Example (cont’d 2 ) Name = { [^(\n]+ } = { [^,) ]+ } Id = { [0-9]+ } student : [Name n] [opt_ s e] [Id id] \n = { } opt_ s : = {} : ( [ e] ) = { } : ( [ e], [ s es] ) = { } s : [ e] = { } : [ e], [ s es] = { } [ e] = { } // -- sequence of students start : [students ss] = { } students : [student s] = { } : [student s] [students ss] = { }

xsugar: Dual Syntax for XML LanguagesTōkyō Daigaku [ July 15, 2005 ] / 4022 // Example (cont’d) Claus Brabrand Anders Moeller Michael Schwartzbach Claus Brabrand Anders Moeller Michael Schwartzbach

xsugar: Dual Syntax for XML LanguagesTōkyō Daigaku [ July 15, 2005 ] / 4023 // Example (cont’d) Claus Brabrand Anders Moeller Michael Schwartzbach Claus Brabrand Anders Moeller Michael Schwartzbach Ambiguous grammar !

xsugar: Dual Syntax for XML LanguagesTōkyō Daigaku [ July 15, 2005 ] / 4024 Unparsing: [N]  representative induces: ~ L (equiv. rel.) “only different wrt. [N]” // Reversibility: Un-/Parsing AST L / ~ L. L.  Parsing: Grammar ambiguity ? Undecidable! However… AST L / ~ L. L. .

xsugar: Dual Syntax for XML LanguagesTōkyō Daigaku [ July 15, 2005 ] / 4025 // Approximating CFG Ambiguity Undecidable ?: However…!: : Safe (over-)approximation: G unambiguous, if: G horizontally unambiguous: G vertically unambiguous: unambiguous ambiguous Yes!. No?.. unambiguous ambiguous ? G G Grammar-level error messages (over-)approximation Black-box

xsugar: Dual Syntax for XML LanguagesTōkyō Daigaku [ July 15, 2005 ] / 4026 // Horizontal Ambiguity Horizontal ambiguity (L): Horizontal ambiguity (X): n : [Id i1] [Id i2] = { : } abxy <= ab:xy  m : [Id i1] “:” [Id i2] = { } L abxy => abx:y ab:xy => abxy  abx:y <= abxy X  

xsugar: Dual Syntax for XML LanguagesTōkyō Daigaku [ July 15, 2005 ] / 4027 // Vertical Ambiguity Vertical ambiguity (L): Vertical ambiguity (X): n : x [Id i] = { ! } : xx [Id i] = { !! } xxy <= !xy  m : ! [Id i] = { x } : !! [Id i] = { xx } X xxy => !!y !xy => xxy  !!y <= xxy L  

xsugar: Dual Syntax for XML LanguagesTōkyō Daigaku [ July 15, 2005 ] / 4028 // Information Preservation “Never throw away or duplicate information”: i.e. all named arguments must be used exactly once! UST AST L / ~ L.. L  X UST AST L / ~ L.. L  X

xsugar: Dual Syntax for XML LanguagesTōkyō Daigaku [ July 15, 2005 ] / 4029 // Information Preservation Information preservation (L): Information preservation (X): m : bar = { } foo (abc) => foo (???) n : foo ( [Id i] ) = { } bar abc bar => ???   X L

xsugar: Dual Syntax for XML LanguagesTōkyō Daigaku [ July 15, 2005 ] / 4030 // Reversible Stylesheets! AST L / ~ L AST X / ~ XML... LX L  X xsugar: 1-1 ! 1-1 ! un-/parsing transformation 1-1 ! transformation 1-1 ! un-/parsing  xsugar 1-1 ! Reversibility (proof): Assume: L X LX s s ss L s X s...

xsugar: Dual Syntax for XML LanguagesTōkyō Daigaku [ July 15, 2005 ] / 4031 Given DTD, D : // Validation Analysis  l  L : x(l)  L (D) L (X)  L (D)   SG(X)  L (D) Black-box “Static Validation of Dynamically Generated HTML” [ Claus Brabrand | Anders Møller | Michael Schwartzbach ] PASTE, 2001

xsugar: Dual Syntax for XML LanguagesTōkyō Daigaku [ July 15, 2005 ] / 4032 Id = { [0-9]+ } Name = { [^(\n]+ } = { [^,) ]+ } student : [Name n] ( [ s es] ) [Id id] \n = { } s : [ e] = { } : [ e], [ s es] = { } // Summary Graphs [0-9]+ [^(\n]+ [^,) ]+ SG(X)  L (D) Black-box “Static Validation of Dynamically Generated HTML” [ Claus Brabrand | Anders Møller | Michael Schwartzbach ] PASTE, 2001

xsugar: Dual Syntax for XML LanguagesTōkyō Daigaku [ July 15, 2005 ] / 4033 // Part 2: Static Analyses Introduction xsugar Syntax and Semantics Unifying Syntax Tree Validation Analysis DTDs & Summary Graphs Schema Languages Reversibility Analysis Grammar Unambiguity Information Preservation Teleportation More Examples Related & Future Work Assessment Conclusion Introduction (xsugar) Static Analyses Assessment 1 2 3

xsugar: Dual Syntax for XML LanguagesTōkyō Daigaku [ July 15, 2005 ] / 4034 Validation Analysis DTDs & Summary Graphs Schema Languages // Part 3: Assessment Introduction xsugar Syntax and Semantics Unifying Syntax Tree Reversibility Analysis Info Preservation Unambiguity Teleportation More Examples Related & Future Work Assessment Conclusion Introduction (xsugar) Static Analyses Assessment 1 2 3

xsugar: Dual Syntax for XML LanguagesTōkyō Daigaku [ July 15, 2005 ] / 4035 // Teleportation ( non-local xformat° ) Int = { [0-9]+ } Str = { “\”” [^\“]+ “\”” } start : [list l] = { } list : [Int n] [list l] = { } : [Str s] = {} } abc l start l l { { { { } } } } abc l start l l { { { } },,,,, abc 1-1

xsugar: Dual Syntax for XML LanguagesTōkyō Daigaku [ July 15, 2005 ] / 4036 // FW: Teleportation (cont’d) Reversibility?: UST AST L / ~ L AST X / ~ XML... transformation LX L  X un-/parsing transformation un-/parsing 1-1/~ L ! 1-1/~ XML ! 1-1! teleportation Int = { [0-9]+ } Str = { “\”” [^\“]+ “\”” } start : [list l] = { } list : [Int n] [list l] = { } : [Str s] = {}

xsugar: Dual Syntax for XML LanguagesTōkyō Daigaku [ July 15, 2005 ] / 4037 // Related Work “XSLT” (aka. XSL Stylesheets): However, only one direction “Presenting XML”: “Java web application framework for presenting HTML, PDF, WML etc., in a device independent manner”. “It aims to achieve a complete separation of content and presentation”. Relax RNGRelax RNC P2P2 P1P1

xsugar: Dual Syntax for XML LanguagesTōkyō Daigaku [ July 15, 2005 ] / 4038 For “Relax NG”: // Assessment lines Conciseness: [ 1 / 12+ ] correspondence ? vs ! maintenance ? vs ! reversibility ? vs ! validity (XML) ? vs ! termination ? vs ! Static guarantees:

xsugar: Dual Syntax for XML LanguagesTōkyō Daigaku [ July 15, 2005 ] / 4039 xsugar: Reversible Stylesheets // Conclusion XL correspondence ! maintenance ! reversibility ! validity (XML) ! termination ! Static guarantees: L2X: Stylesheet: L  X X2L: Reverse stylesheet: X  L xsugar s : L  X

xsugar: Dual Syntax for XML LanguagesTōkyō Daigaku [ July 15, 2005 ] / 4040 Questions please… /

xsugar: Dual Syntax for XML LanguagesTōkyō Daigaku [ July 15, 2005 ] / 4041 // Schema Languages The xsugar Schema Language ® : Generalization (from Regexps to CFGs): Full CFG structure for PCDATA Full CFG structure for attribute values x  L (X) ?

xsugar: Dual Syntax for XML LanguagesTōkyō Daigaku [ July 15, 2005 ] / 4042 // More Examples: “ Nice.xsg ” a xx yyy b n : a [xs x_s] [ys y_s] b = { } xs : = {} : x [xs x_s] = { } // X: sequence ys : = {} : y [ys y_s] = { } // Y: nested 