SGML

Rank Examples

rank/rank0 rank/rank1
Examples for using ranked elements
Note: To process SGML from the example sources, copy and paste an example source, store it into a file with the ".sgm" file extension, and invoke
sgmlproc <your-file.sgm>
where <your-file.sgm> is replaced by the actual file used for storing.

rank/rank0

<!DOCTYPE test [
	<!ELEMENT test - - ((h1|h2|h3|p1|p2|p3)+)>
	<!ELEMENT (h|p) 1 - - (#PCDATA)>
	<!ELEMENT (h|p) 2 - - (#PCDATA)>
	<!ELEMENT (h|p) 3 - - (#PCDATA)>
]>
<test>
<h1>Heading 1</h1>
<p>Paragraph 1</p>
<h2>Heading 1.1</h2>
<p>Paragraph 1.1</p>
<h3>Heading 1.1.1</h3>
<p>Paragraph 1.1.1</p>
</test>

rank/rank1

<!DOCTYPE test [
	<!ELEMENT test - - ((h1|h2|h3|p1|p2|p3)+)>
	<!ELEMENT (h|p) 1 - - (#PCDATA)>
	<!ELEMENT (h|p) 2 - - (#PCDATA)>
	<!ELEMENT (h|p) 3 - - (#PCDATA)>
]>
<test>
<h2>Heading 1</h2>
<p>Paragraph 1</p>
<h>Heading 1.1</h>
</test>