Interscript An Interchange Standard for Editable Documents Motivation, Goals, and Constraints The Base Language: A Travelogue The Layout Model Some Standard Constructs Interscript Presentation to ANSI X3V1 January, 1984 Motivation, Goals, and Constraints Motivation and Goals What properties should an interchange standard have? What Interscript is not What is in the first version of Interscript? Interscript Presentation to ANSI X3V1 January, 1984 Motivation and Goals Motivation Xerox needs an interchange standard for editable documents for compatibility among products for product evolution The office systems world needs an interchange standard for editable documents to replace paper documents It is an interesting technical problem Goals A standard that can span a wide product range A standard that can evolve A standard that supports What-You-See-Is-What-You-Get (WYSIWYG) editors formatting languages Interscript Presentation to ANSI X3V1 January, 1984 What properties should an interchange standard have? It must be "as simple as possible, but no simpler" It must enable interchange among editors with different capabilities It must be simple to internalize a script Both form and content must be representable Structure must be representable and preservable It must be simple to externalize a document The encoding should be efficient in space and time It must be extensible Interscript Presentation to ANSI X3V1 January, 1984 What Interscript is not It is not a file format It is not a standard for editing It is not an editing system itself combining documents is not an Interscript function It is not a substitute for other standards e.g., character codes, font naming It is not intended for direct communication among people Interscript Presentation to ANSI X3V1 January, 1984 What is in the current version of Interscript? A processing model internalization  editing  externalization ( script > document > script ) A (solid) basis for a standard a description language that can be extended by definition small compact syntax precise formal semantics Standardized document constructs TEXT (FONT, TAB) PARAGRAPH TABLE (TABLEROW, TABLEENTRY, COLUMNSPLIT) Standardized layout constructs description not prescription: TEX-like a general layout model overall document layout page layout character placement Interscript Presentation to ANSI X3V1 January, 1984 The Base Language: A Travelogue Why a Description Language? Syntax and Semantics by Example When are Two Scripts Equivalent? Tags and Node Invariants Ignorance-Based Editing Interscript Presentation to ANSI X3V1 January, 1984 Why a Description Language? Any interchange format constitutes a description language Documents are richly structured A document interchange standard must be able to evolve smoothly Simple documents should be simple A simple language with an extension-by-definition facility has these properties Computer-language research has developed tools for expression and precision programming languages and specification languages compiler technology syntax-description languages formal semantics languages The description language and its encoding are separable issues Interscript Presentation to ANSI X3V1 January, 1984 Syntax and Semantics by Example (1) A script is a tree of nodes { "This string is the only content of this node" } A script is a tree of nodes INTERSCRIPT/INTERCHANGE/1.0 { DOCUMENT$ { TEXT$ "This is the first subnode of the document" } { TEXT$ "This string is the only content of this node" } } ENDSCRIPT Basic values are atoms, numbers, strings, and quoted expressions Atoms: TEXT DOCUMENT SimpleId any.qualified.name Numbers: 0 1 2 3.14159 1.7E3 Strings: "just characters in quotes" Quoted Expressions: '3+5' '{ PARAGRAPH$ leftMargin_2540 }' Interscript Presentation to ANSI X3V1 January, 1984 Syntax and Semantics by Example (2) An attribute is a name-value pair leftMargin _ 36 Expressions are very simple leftMargin^ leftMargin^ LT (rightMargin^  20) leftMargin^+rightMargin^  20 The only kind of structured value is a node A content-only node is like a vector a _ { "Now " "is " "the " "time " "for " . . . } a^!0 An attribute-only node is like a record origin _ { CARTESIAN$ x_0 y_0 z_0} origin.y^ A node may hold both contents and attributes { TEXT$ font _ TimesRoman^ --an attribute-- "This string is the only content of this node" } Interscript Presentation to ANSI X3V1 January, 1984 Syntax and Semantics by Example (3) A node's semantics are based on its tags { TABLE$ heading_{TEXT$ "Frooble production by territory"} { TABLEROW$ { TABLEENTRY$ { TEXT$ "Yukon" } } { TABLEENTRY$ {TEXT$ "200 froobles"} } . . . } } A node value may be opened to supply items { TABLE$ heading_{TEXT$ "Frooble production by territory"} { TABLEROW$ subEg _ {TABLEENTRY$} { subEg^| {TEXT$ "Yukon" } } { subEg^| {TEXT$ "200 froobles"} } . . . } } Interscript Presentation to ANSI X3V1 January, 1984 Syntax and Semantics by Example (4) Name scopes nest subEg _ 7 { TABLE$ heading_{TEXT$ "Frooble production by territory" } { TABLEROW$ subEg _ {TABLEENTRY$} { subEg^| {TEXT$ "Yukon" } } { subEg^| {TEXT$ "200 froobles" } } . . . } } Interscript Presentation to ANSI X3V1 January, 1984 Syntax and Semantics by Example (5) Representing Structure in Documents Kinds of structure: Inheritance  nesting and names "Styles"  by name (indirection) Associating separate parts  by name (indirection) Structural evaluation name% instead of name^ sb^+7 and 5+7 and 12 are equivalent sb%+7 has value 12, but it is only equivalent to sb%+7 Structural node opening name%| instead of name^| format.body %_ {PARAGRAPH$ lineJustification_True^ font _ TimesRoman^ } { format.body%| . . . } has value { PARAGRAPH$ lineJustification_True^ font _ TimesRoman^ . . . } Structural binding sb %_ 5 Interscript Presentation to ANSI X3V1 January, 1984 When are Two Scripts Equivalent? When they have the same formal semantics The formal semantics map a script into a tree of "tuples" The semantics define a canonical representation Two scripts are equivalent if their semantics match Equivalence enables the testing of editors Does the editor produce valid scripts? Are internalization and externalization an idempotent pair? Interscript Presentation to ANSI X3V1 January, 1984 Tags and Node Invariants Every tag has a declaration that includes the names and types of relevant attributes the type of the allowable content An invariant for nodes with this tag (a predicate) any other tags that must also be present on a node with this tag A tag's properties can be defined in Interscript Interscript Presentation to ANSI X3V1 January, 1984 Ignorance-Based Editing An editor may display whatever it can recognize Editing known quantities in the context of unknown quantities the text caption of a figure the frame for some synthetic graphics Any operation that preserves invariants results in a valid script perform semantically meaningful operations satisfy invariant without understanding it change nothing (contents, tags, relevant attributes) Interscript Presentation to ANSI X3V1 January, 1984