SGML

Element Declaration using Namegroups Examples

namegroup-element-declarations/element-decl-namegroup0
Example of declaring a group of elements in a single declaration
namegroup-element-declarations/element-decl-namegroup1
Example of declaring a group of elements in a single declaration, with the instance document violating its declaration

namegroup-element-declarations/element-decl-namegroup0

<!DOCTYPE test [
	<!ELEMENT test - - (other, yetanother?)>
	<!ELEMENT (other | yetanother) (#PCDATA)>
]>
<test><other>bla</other><yetanother>text</yetanother></test>

Result

<!DOCTYPE test [
	<!ELEMENT test - - (other, yetanother?)>
	<!ELEMENT (other | yetanother) (#PCDATA)>
]>
<test><other>bla</other><yetanother>text</yetanother></test>

namegroup-element-declarations/element-decl-namegroup1

<!DOCTYPE test [
	<!ELEMENT test - - (other, yetanother?)>
	<!ELEMENT (other | yetanother) (#PCDATA)>
]>
<test><other>bla</other><yetanother>the following element is unexpected<test></test></yetanother></test>

Result


"element-decl-namegroup1.sgm": line 5: fatal: 'yetanother': 'test' not accepted here