home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #31 / NN_1992_31.iso / spool / comp / text / sgml / 1241 < prev    next >
Encoding:
Internet Message Format  |  1992-12-28  |  2.2 KB

  1. Path: sparky!uunet!spool.mu.edu!yale.edu!ira.uka.de!fhg!igd!rath
  2. From: rath@igd.fhg.de (Hans Holger Rath)
  3. Newsgroups: comp.text.sgml
  4. Subject: Precedence of SGML Operators?
  5. Keywords: SGML, Operator Precedence, MARKIT-Parser
  6. Message-ID: <1802@igd.fhg.de>
  7. Date: 28 Dec 92 11:14:01 GMT
  8. Sender: news@igd.fhg.de
  9. Organization: Haus der Graphischen Datenverarbeitung, 6100 Darmstadt, Germany
  10. Lines: 67
  11.  
  12.  
  13. Hey folks,
  14.  
  15. I've I problem with the operator precedence in SGML.
  16.  
  17. I parsed an incorrect (?) SGML file with the markit 2.0 parser, but no
  18. error message or warning occurs.
  19.  
  20. The problem in detail:
  21.  
  22. When the DTD has following element definition
  23.  
  24. <!ELEMENT x - - (z, (a* | b*)) >
  25.  
  26. (with the intention to allow a z followed by repeatative a's OR repeatative b's)
  27.  
  28. and the sgml instance looks like this
  29.  
  30.     <x>
  31.     <z>...</z>
  32.     <a>...</a>
  33.     <b>...</b>        <------- !!! Error !!! ------->
  34.     <a>...</a>
  35.     </x>
  36.  
  37. the markit says, that it is okay.
  38.  
  39. When I change the element definition to
  40.  
  41.     <!ELEMENT x - - (z, ((a*) | (b*))) >
  42.                          -  -   -  -
  43.  
  44. the markit prints an error message for the "b" tag, what I expected already with
  45. the first definition.
  46.  
  47. Is this a bug of the markit or is my interpretation of the operator precedence
  48. in SGML wrong?
  49.  
  50. Is the first element definition equivalent to
  51.  
  52.     <!ELEMENT x - - (z, ((a* | b)*)) > ???
  53.                          _      _
  54.  
  55. I don't think so and Mr. Martin Bryan in "SGML an Author's Guide", page 111 don't
  56. think so, too.
  57.  
  58. I always thought, that the occurence indicators ("?", "+", "*") have a higher
  59. precedence than the group connectors ("|", ",", "&").
  60.  
  61. What do the experts think about these problems?
  62.  
  63.  
  64. Thanks in advance,
  65.  
  66. --Holger
  67.  
  68.  
  69. P.S.: I wish everybody an HAPPY NEW YEAR.
  70.  
  71. ---------------------------------------------------------------------
  72. | Hans Holger Rath - Computer Graphics Center - Darmstadt - Germany |
  73. ---------------------------------------------------------------------
  74. |            Zentrum fuer            |    EMail: rath@igd.fhg.de    |
  75. | Graphische Datenverarbeitung e. V. |                              |
  76. |        Wilhelminenstrasse 7        |    Tel. : +49 6151/155-245   |
  77. |          D-6100 Darmstadt          |    Fax  : +49 6151/155-299   |
  78. ---------------------------------------------------------------------
  79.