SGML

Marked Section Examples

marked-sections/marked-section4 marked-sections/marked-section6
Basic example for marked sections used in content
marked-sections/marked-section7

Basic example for a RCDATA marked section; the RCDATA keyword is expanded from the rc parameter entity; an RCDATA marked section gets serialized as CDATA marked section in the output

marked-sections/marked-section8

An omitted keyword in a marked section, or an entity reference that expands to an empty or blank character sequence, is treated as if INCLUDE was specified as keyword

marked-sections/marked-section9

If both IGNORE and INCLUDE are specified as keyword, then IGNORE takes precedence

marked-sections/marked-section-in-prolog1
Basic example for marked sections used in the document prolog
marked-sections/marked-section-in-prolog3
Example for nested marked sections used in the document prolog
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.

marked-sections/marked-section4

<!DOCTYPE test [
	<!ELEMENT test - - (#PCDATA|bla)*>
	<!ELEMENT bla - - (#PCDATA)>
]>
<test><![ INCLUDE[<bla></bla><bla></bla>text<bla></bla>]]></test>

marked-sections/marked-section6

<!DOCTYPE test [
	<!ELEMENT test - - (#PCDATA|bla)*>
	<!ELEMENT bla - - (#PCDATA)>
]>
<test><![ IGNORE[<bla></bla><bla></bla>text<bla></bla>]]></test>

marked-sections/marked-section7

<!DOCTYPE test [
	<!ENTITY % rc "RCDATA">
	<!ENTITY someent "hello">
	<!ELEMENT test - - (#PCDATA)>
]>
<test><![%rc;[&someent;, world!]]></test>

marked-sections/marked-section8

<!DOCTYPE test [
	<!ENTITY someent "hello">
	<!ELEMENT test - - (#PCDATA)>
]>
<test><![ [&someent;, world!]]></test>

marked-sections/marked-section9

<!DOCTYPE test [
	<!ENTITY someent "hello">
	<!ELEMENT test - - (#PCDATA)>
]>
<test><![IGNORE INCLUDE [&someent;, world!]]></test>

marked-sections/marked-section-in-prolog1

<!DOCTYPE test [
	<![INCLUDE[
		<!ELEMENT test - - (#PCDATA)>
	]]>
]>
<test></test>

marked-sections/marked-section-in-prolog3

<!DOCTYPE test [
	<![INCLUDE[
		<!ENTITY % incl "INCLUDE">
		<![%incl;[
			<!ELEMENT test - - (#PCDATA)>
		]]>
	]]>
]>
<test></test>