O'Reilly logo

Effective XML: 50 Specific Ways to Improve Your XML by Elliotte Rusty Harold

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Conditional Sections

As the next step, we can allow particular documents to enable or disable particular parts of the DTD. This is accomplished with INCLUDE and IGNORE sections. The basic syntax for these directives appears below.

<![INCLUDE[
  <!-- Declarations the parser reads -->
]]>
<![IGNORE[
  <!-- Declarations the parser ignores -->
]]>

Note that the syntax is the same except for the keyword. By defining the keyword as a parameter entity reference, you can provide a switch customizers can use to turn sections of the DTD on or off. These can be individual declarations or groups of related declarations.

For example, some bank subsidiaries with different systems might wish to leave out an explicit closing balance since it can be calculated ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required