home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #16 / NN_1992_16.iso / spool / comp / text / sgml / 954 < prev    next >
Encoding:
Text File  |  1992-07-30  |  4.2 KB  |  88 lines

  1. Newsgroups: comp.text.sgml
  2. Path: sparky!uunet!mcsun!sunic!aun.uninett.no!nuug!ifi.uio.no!naggum.no
  3. From: Erik Naggum <erik@naggum.no>
  4. Sender: Erik Naggum <enag@ifi.uio.no>
  5. Reply-To: Erik Naggum <enag@ifi.uio.no>
  6. Message-ID: <23266B@erik.naggum.no>
  7. Date: 31 Jul 1992 03:56:49 +0200
  8. Subject: Overlapping element structures
  9. Lines: 72
  10.  
  11. SGML cannot handle overlapping element structures under the intuitive
  12. semantics of the element structure, but if we introduce an ability to
  13. concatenate elements, as additional semantics in the application, we
  14. could easily accomplish this.
  15.  
  16. Steve DeRose has proposed using a new attribute type, and I draw from
  17. his suggestion, but I consider it difficult to use ID and IDREF, or any
  18. scheme derived from them, because overlapping regions can easily be
  19. split by intervening markup, and then we have the same element instance
  20. conceptually continued, as opposed to one of them referring in any sense
  21. to the other.  That is, we should ideally have two elements with the
  22. same ID attribute, but we can't do that, because IDs have to be unique
  23. across the entire document.  Eliot Kimber has argued for the difficulty
  24. in maintaining the ID space in large documents, and I think it's
  25. therefore wise not to use IDs for this purpose.
  26.  
  27. My proposal makes use of a special name attribute, which I call
  28. "instance" (but which, for more generality, could be an attribute
  29. architectural form), which identifies, within an application-defined
  30. part of the element structure (such as inside a particular element), the
  31. individual instance of an element.  Such an element can be split into
  32. pieces which are dispersed in the document instance, but which are
  33. conceptually concatenated for those applications which need it.
  34.  
  35. Take the example of paragraphs and quotations.  When used in quoting
  36. direct speech, paragraph breaks may occur in the quotation, and the
  37. easiest way to handle them is to allow paragraphs in quotations.  This,
  38. however, does violence to the sequence of paragraphs, such that a given
  39. paragraph element contains the entire quotation, instead of only the
  40. first paragraph of the quotation.  This produces very counter-intuitive
  41. addressing if, say, HyTime's treeloc's are used, or when intelligent
  42. search and retrieval functions are used, because a paragraph number will
  43. not correspond to the formatted output, if paragraphs containing and
  44. contained in quotations appear identically, and will needlessly clutter
  45. the addressing scheme.
  46.  
  47. A named instance of the element should solve the problem, and we leave
  48. to the application to specify the semantics in the concatenation.  As a
  49. contrived example, consider the following fragments:
  50.  
  51. <!ELEMENT p    (#PCDATA|...|q|...)*>
  52. <!ELEMENT q    (#PCDATA|...)*>
  53. <!ATTLIST q    instance NAME #CURRENT>
  54.  
  55. <p><q instance=ceotalk>Ladies and gentlemen...</q>, he said, and paused
  56. to allow the guests to finish the smalltalk at the tables.</p>
  57. <p><q>We are gathered here today...</q></p>
  58. <p><q>...</q></p>
  59.  
  60. Note the use of CURRENT default values.  This means that all Q elements
  61. need an INSTANCE attribute value, which could be a disadvantage.  The
  62. other option is to use IMPLIED as the default value, and require all Q
  63. elements which are part of a concatenated element to specify the
  64. attribute value.  This has disadvantages in typing, and makes use of
  65. SHORTREF next to impossible, but is significantly easier to handle and
  66. deal with, and is not as error prone as the CURRENT approach, in
  67. particular with respect to an erroneously omitted attribute value
  68. specification.
  69.  
  70. It would now be possible to extract the entire speech by requesting all
  71. elements of type Q with INSTANCE equal to CEOTALK.
  72.  
  73. This does not necessarily handle the problem of overlapping regions,
  74. where the contents of one element is also the contents of another, but
  75. this may be best solved with judicious use of the CONCUR feature
  76. (provided one has a parser which does not consider it required to give
  77. the application program access to only one document type at a time).
  78.  
  79. I think this solves most of the problem, anyway.
  80.  
  81. Best regards,
  82. </Erik>
  83. --
  84. Erik Naggum             |  ISO  8879 SGML     |      +47 295 0313
  85.                         |  ISO 10744 HyTime   |
  86. <erik@naggum.no>        |  ISO 10646 UCS      |      Memento, terrigena.
  87. <enag@ifi.uio.no>       |  ISO  9899 C        |      Memento, vita brevis.
  88.