XML output

Overview

This section describes the XML DTD.

DTD


<!-- Top-level element is "mql_results" -->
<!DOCTYPE mql_results   
  [

  <!-- "mql_results" is zero or more "mql_result"'s
  <!ELEMENT mql_results (mql_result)* > 
  <!ATTLIST mql_results >


  <!-- "mql_result" consists of:
       * An optional "mql_progress",
       * A "status"
       * An optional "error"
       * An optional "warning"
       * Either a "table", a "sheaf", or nothing

       An "mql_result" is emitted for each statement in the
       input stream.
  -->
  <!ELEMENT mql_result ((mql_progress)?, status, (error)?, 
                        (warning)?, (table|sheaf)?) >
  <!ATTLIST mql_result  >


  <!-- "mql_progress" is just a series of dots emitted at intervals 
       while processing a "SELECT (FOCUS|ALL) OBJECTS" query. 
  -->
  <!ELEMENT mql_progress (#PCDATA)* >


  <!-- The empty "status" element shows, via its "success" attribute
       whether the statement succeeded or not (i.e., whether an error
       occurred. 
  -->
  <!ELEMENT status EMPTY >
  <!ATTLIST status 
                success (true|false) #REQUIRED >


  <!-- The "error" element is only emitted if an error occurred. -->
  <!ELEMENT error (error_source, error_stage, 
                   error_message_db, error_message_compiler) >
  <!ATTLIST error >

  <!-- The "error_source" element, being part of the "error" element,
       is only emitted if an error occurred.  It shows the source of 
       the error: whether it was the MQL compiler or the database 
       back-end.
  -->
  <!ELEMENT error_source EMPTY >
  <!ATTLIST error_source 
                source  (compiler|db) #REQUIRED >


  <!-- The "error_stage" element, being part of the "error" element,
       is only emitted if an error occurred.  It shows in which stage
       of the compiler the error occurred. 
  -->
  <!ELEMENT error_stage EMPTY >
  <!ATTLIST error_stage  
                stage   (none|parse|weed|symbol|type|monads|exec) #REQUIRED >


  <!-- The "error_message_db" element, being part of the "error" element,
       is only emitted if an error occurred.  It contains any error-message
       from the back-end.
  -->
  <!ELEMENT error_message_db (#PCDATA)* >
  <!ATTLIST error_message_db >


  <!-- The "error_message_compiler" element, being part of the "error"
       element, is only emitted if an error occurred.  It contains any
       error-message from the compiler.
  -->
  <!ELEMENT error_message_compiler (#PCDATA)* >
  <!ATTLIST error_message_compiler >

  <!-- The "warning" element shows the text of any warning from the
       compiler.
  -->
  <!ELEMENT warning (#PCDATA)* >
  <!ATTLIST warning >



  <!-- *************
       *** Table ***
       *************
  -->

  <!-- A "table" is a "theader" followed by zero or more "trow"'s. -->
  <!ELEMENT table (theader, trow*) >
  <!ATTLIST table >


  <!-- A "theader" is zero or more "theadercolumn"'s -->
  <!ELEMENT theader (theadercolumn)* >
  <!ATTLIST theader >


  <!-- A "theadercolumn" is a "tcaption" followed by a "ttype" -->
  <!ELEMENT theadercolumn (tcaption, ttype) >
  <!ATTLIST theadercolumn >


  <!-- A "tcaption" gives the name of a column-header. -->
  <!ELEMENT tcaption (#PCDATA)* >
  <!ATTLIST tcaption >


  <!-- A "ttype" gives the type of a column.  If the type is "enum",
       the "enum_type" attribute gives the name of the enum.
  -->
  <!ELEMENT ttype EMPTY >
  <!ATTLIST ttype 
     type (bool|string|integer|id_d|enum) #REQUIRED
     enum_type CDATA #IMPLIED >


  <!-- A "trow" is zero or more "tcolumn"'s.  The number of columns in
       a "trow" is always the same throughout the table, and is also
       the same as the number of "theadercolumn"'s in the "theader".
  -->
  <!ELEMENT trow (tcolumn)* >
  <!ATTLIST trow >


  <!-- A "tcolumn" contains the value of a column in a row. -->
  <!ELEMENT tcolumn (#PCDATA)* >
  <!ATTLIST tcolumn >


  <!-- *************
       *** Sheaf ***
       *************
  -->

  <!-- A "sheaf" is zero or more "straw"'s. -->
  <!ELEMENT sheaf (straw)* >
  <!ATTLIST sheaf >

  <!-- A "straw" is zero or more "matched_object"'s. -->
  <!ELEMENT straw (matched_object)* >
  <!ATTLIST straw >


  <!-- A "matched_object" is a "monad_set" followed by an optional
       "sheaf".  The optional sheaf constitutes a match of the inner
       blocks from the block which gave rise to the matched_object.

       The "focus" boolean tells whether the block in question had the
       "focus" modifier.

       The "object_type_name" attribute is the object type name of the
       object that matched the object_block(_first) which gave rise to
       this matched_object.

       The "id_d" is the object id_d of the object that matched the
       object_block(_first) which gave rise to this matched_object.
  -->
  <!ELEMENT matched_object (monad_set, (sheaf)?) >
  <!ATTLIST matched_object 
            object_type_name CDATA #REQUIRED 
            focus (false | true) #REQUIRED
            marks (CDATA) #IMPLIED
            id_d CDATA "nil"
  >


  <!-- A "monad_set" is one or more "mse"'s." -->
  <!ELEMENT monad_set (mse)+ >
  <!ATTLIST monad_set >

  <!-- An "mse" a "monad set element".  It is a pair of attributes,
       "first" and "last", each of which gives the first and the last
       monad (a 10-base integer) of the monad set element.  See the
       document "Monad Sets -- Implementation and Mathematical
       Foundations" for an explanation.
  -->
  <!ELEMENT mse EMPTY>
  <!ATTLIST mse
            first CDATA #REQUIRED
            last  CDATA #REQUIRED
  >
]>


Previous:IntegerList
Up:Part II: APIs
Next:Part III: Tips