Re: (off topic) MCF and XML-data and declarations in instances

Someone suggested offline that I should post an 
example of [HyTime] description tables, so here is something.

It uses the HyTime description tables, linked with
xml-link syntax (more or less...)

(Please do not repost this outside the group, it is 
from a draft that may be in my book, so it is (C) me
and has not been checked, etc etc etc. )

Rick Jelliffe

-------------------------------------------------------

DOCUMENTATION

Here is a way to provide structured documentation 
for element types and attributes,
using [HyTime] description tables and the [XML] link
syntax.

The first step is to make a description table. 
This has a pattern similar to the
HTML definition list:

 <!ELEMENT desctab - O (desctxt, descdef)+ >
 <!ATTLIST desctab 
    id ID #REQUIRED>
 <!ELEMENT desctxt O O (#PCDATA)>
 <!ELEMENT descdef O O (%stuff;)>

where %stuff; is whatever element set you need. 
For example, you could have  

 <desctab id="mydtd">

 <desctxt>title</desctxt>
 <descdef>
  <menu lang="EN">title</menu>
  <menu lang="DE">titel</menu>
  <p>The title (e.g. of an article, or subsection).
 Must start with a number.</p>
  <lextype>[0-9]#+</lextype>
 </descdef>

 <desctxt>para</desctxt>
 <descdef>
  <menu lang="EN">paragraph</menu>
  <menu lang="DE">strophe</menu>
  <p>A logical paragraph. It may contain
 embedded lists, tables and figures.</p>
 </descdef>

 <desctxt>article</desctxt>
 <descdef>
  <menu lang="EN">article</menu>
  <menu lang="DE">artikel</menu>
  <p>The top level element for articles.</p>
  <lextype>#+</lextype>
 </descdef>
 </desctab>

which specifies a table with three descriptions. 

The definitions include element for GUI
menu item text in English and German, a text 
explanation, and a lexical typing model
(using the HyLex syntax from [HyTime]), to allow 
a computer to perform stronger
typeing checks of the data. It could be extended 
according to taste to add
documentation and typing for attributes as well.

 <!ATTLIST art
    doco CDATA #IMPLIED   -- an XML link -->

and then 

 <!-- RICK: CHECK RECENT XML-LINK SYNTAX -->
 <art  doco="#ID(mydtd)child(ID(article))..DITTO(successor)">
 <title>1 Beginning</title>
 ....</art>

You application must be programmed to interpret 
the documentation attribute as a
hypertext reference, of course, but the 
information is there. 

Received on Sunday, 29 June 1997 04:24:12 UTC