home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #16 / NN_1992_16.iso / spool / comp / text / sgml / 935 < prev    next >
Encoding:
Internet Message Format  |  1992-07-24  |  3.6 KB

  1. Path: sparky!uunet!ebt-inc!uhura!sjd
  2. From: sjd%ebt-inc@uunet.uu.net (Steve DeRose)
  3. Newsgroups: comp.text.sgml
  4. Subject: Straw man proposal for overlapping markup
  5. Message-ID: <5431@ebt-inc.UUCP>
  6. Date: 24 Jul 92 15:07:56 GMT
  7. Sender: news@ebt-inc.UUCP
  8. Organization: EBT
  9. Lines: 76
  10. Originator: sjd@uhura
  11.  
  12. Here's a straw-man proposal for an upgrade to SGML for handling overlapping
  13. markup streams.  I won't claim it's very pretty, but it has advantages:
  14.  
  15.    * It requires *no* changes to the syntax of SGML documents, but
  16.      only an additional keyword permitted in ATTLIST declarations in DTDs.
  17.  
  18.    * A parser that doesn't know about it could ignore the keyword and
  19.      produce acceptable output (such as the identical ESIS).
  20.  
  21.    * Unbounded numbers and types of overlaps can be encoded inline.
  22.  
  23.    * The element relationships are pretty human-readable and findable.
  24.  
  25.    * A parser that does know about the construct can at least validate
  26.      that all tags for overlapping elements balance.
  27.  
  28. The mechanism is somewhat similar to Eliot's recent proposal; it is
  29. also among several approaches discussed over the last
  30. four years by the relevant Text Encoding Initiative committees, and for
  31. slightly longer by the CHUG Hypermedia Working Group.
  32.  
  33. Here it is, building on my previous example:
  34.  
  35.    <!ELEMENT speech.start - - EMPTY>
  36.    <!ATTLIST speech.start connect  STARTID #REQUIRED>
  37.    <!ELEMENT speech.end   - - EMPTY>
  38.    <!ATTLIST speech.end   connect  ENDID   #REQUIRED>
  39.  
  40.    <speechstart speaker='Sir John' connect=chunk5>
  41.    <poetry-line>Greetings, O brave defender of our right,</poetry-line>
  42.    <poetry-line>'Till now, I thought you knew not how to Write</poetry-line>
  43.    <poetry-line>but heavy Morals.
  44.    <speechend connect=chunk5>
  45.  
  46.    <speechstart speaker='Melissa' connect=chunk7>
  47.    These my Pens imploy</poetry-line>
  48.    <poetry-line>for all my business was to pall Your Joy:</poetry-line>
  49.    ...
  50.    <speechend connect=chunk7>
  51.  
  52. Almost exactly as with ID and IDREF attributes, there is a validity constraint:
  53.  
  54.    * The value of a STARTID attribute must be unique among all STARTID
  55.      attribute values in a document instance.
  56.      
  57.    * The value of a ENDID attribute must be unique among all ENDID
  58.      attribute values in a document instance.
  59.  
  60.    * Every STARTID attribute value in a document instance must also occur
  61.      as exactly one ENDID attribute value *later* in the same document.
  62.    
  63. This is slightly easier to check than ID/IDREF matching, and guarantees a
  64. certain level of integrity.  The semantics of the overlap are in the
  65. application's domain (say, whether it should be highlighted, editable,
  66. whether there are cross-constraints between overlaps, etc).
  67.  
  68. A slight improvement to this construct would have you declare both attributes
  69. for the *same* GI, and have the constraint that the elements having
  70. matching STARTID/ENDID must be of the same GI.  I actually like this larger
  71. extension much better, because it strengthens validation and allows using
  72. the GI to actually reflects the types of overlapping elements (rather than
  73. permitting only a naming convention such as "speech.start" and "speech.end").
  74.  
  75. I also see it as a plus that current parsers can handle documents using
  76. either construct without even being upgraded, simply by letting the user
  77. change the DTD to read "ID" for "STARTID" and "IDREF" for "ENDID" (although
  78. this weakens validation and expressiveness, documents can be created and
  79. meaningfully parsed right now).
  80.  
  81. Anybody see problems with this idea?  It does not attempt to address
  82. Darrell's case of truly discontiguous elements, only the case of contiguous
  83. but overlapping elements.  With a little tuning would this make sense for
  84. some of the applications we've been discussing?
  85.  
  86.  
  87. Steve DeRose
  88.