SGML

Compositor Parsing Precedence Examples

compositor-parsing-precedence/test1.sgm

SP requires that no two different content model compositors compete for a nonterminal as is the case for the b token in the content model declaration for the test element; the content model expression is rejected by SP, but not $productname

compositor-parsing-precedence/test2.sgm
OTOH, explicitly enclosing subexpressions is accepted by both SP and $productname

compositor-parsing-precedence/test1.sgm

<!DOCTYPE test [
	<!-- NOT ACCEPTED BY SP -->
	<!ELEMENT test O O (a,b|c) >
	<!ELEMENT a - - (#PCDATA) >
	<!ELEMENT b - - (#PCDATA) >
	<!ELEMENT c - - (#PCDATA) >
]>
<test><a>fasel</a><b>bla</b></test>

compositor-parsing-precedence/test2.sgm

<!DOCTYPE test [
	<!ELEMENT test O O ((a,b) | c) >
	<!ELEMENT a - - (#PCDATA) >
	<!ELEMENT b - - (#PCDATA) >
	<!ELEMENT c - - (#PCDATA) >
]>
<test><a>fasel</a><b>bla</b></test>