Name

Conditional Sections

Synopsis

The conditional section markup provides support for conditionally including and excluding content at parse time within an XML document’s external subset. Conditional sections are not allowed within a document’s internal subset. The following example illustrates a likely application of conditional sections:

<!ENTITY % debug 'IGNORE' >
<!ENTITY % release 'INCLUDE' >
 
<!ELEMENT addend (#PCDATA)>
<!ELEMENT result (#PCDATA)>
 
<![%debug;[
<!ELEMENT sum (addend+, result)>
]]>
<![%release;[
<!ELEMENT sum (result)>
]]>

Get XML in a Nutshell, 3rd Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.