Benjamin Niemann
2006-07-28 10:09:28 UTC
Hello,
before I file a bug report, I want to see, if my understanding of the SGML
standard is correct.
According to the SGML Handbook, the omitted tag minimization parameters
should not influence how the document is parsed (e.g. which tags are
implied).
But a simple test document (see below) shows that onsgmls (1.5.2) does make
a difference here (just checked nsgmls 1.3.4 - same result).
Am I correct that the end tag for A1 must be implied before the start tag
for A2 (as it is done for B1)?
---- the test document ----
<!DOCTYPE document [
<!ELEMENT document - - (a,b)>
<!ELEMENT a - - (a1|a2)+>
<!ELEMENT (a1,a2) - - (#PCDATA)>
<!ELEMENT b - - (b1|b2)+>
<!ELEMENT (b1,b2) - O (#PCDATA)>
]>
<document>
<!-- end tag for a1 is not optional but unambiguous -->
<a><a1>foo<a2>bar</a2></a>
<!-- output of onsgmls:
onsgmls:sgml-implicit-tags-04.sgml:16:15:E: document type does not allow
element "A2" here
onsgmls:sgml-implicit-tags-04.sgml:16:27:E: end tag for "A1" omitted, but
its declaration does not permit this
onsgmls:sgml-implicit-tags-04.sgml:16:5: start tag was here
(A
(A1
-foo
(A2
-bar
)A2
)A1
)A
-->
<!-- end tag for b1 is optional and unambiguous -->
<b><b1>foo<b2>bar</b2></b>
<!-- output of onsgmls:
(B
(B1
-foo
)B1
(B2
-bar
)B2
)B
-->
</document>
---- EOF ----
before I file a bug report, I want to see, if my understanding of the SGML
standard is correct.
According to the SGML Handbook, the omitted tag minimization parameters
should not influence how the document is parsed (e.g. which tags are
implied).
But a simple test document (see below) shows that onsgmls (1.5.2) does make
a difference here (just checked nsgmls 1.3.4 - same result).
Am I correct that the end tag for A1 must be implied before the start tag
for A2 (as it is done for B1)?
---- the test document ----
<!DOCTYPE document [
<!ELEMENT document - - (a,b)>
<!ELEMENT a - - (a1|a2)+>
<!ELEMENT (a1,a2) - - (#PCDATA)>
<!ELEMENT b - - (b1|b2)+>
<!ELEMENT (b1,b2) - O (#PCDATA)>
]>
<document>
<!-- end tag for a1 is not optional but unambiguous -->
<a><a1>foo<a2>bar</a2></a>
<!-- output of onsgmls:
onsgmls:sgml-implicit-tags-04.sgml:16:15:E: document type does not allow
element "A2" here
onsgmls:sgml-implicit-tags-04.sgml:16:27:E: end tag for "A1" omitted, but
its declaration does not permit this
onsgmls:sgml-implicit-tags-04.sgml:16:5: start tag was here
(A
(A1
-foo
(A2
-bar
)A2
)A1
)A
-->
<!-- end tag for b1 is optional and unambiguous -->
<b><b1>foo<b2>bar</b2></b>
<!-- output of onsgmls:
(B
(B1
-foo
)B1
(B2
-bar
)B2
)B
-->
</document>
---- EOF ----
--
Benjamin Niemann
Email: pink at odahoda dot de
WWW: http://pink.odahoda.de/
Benjamin Niemann
Email: pink at odahoda dot de
WWW: http://pink.odahoda.de/