Wattle Software - producers of XMLwriter XML editor
 Home | Search | Site Map 
XMLwriter
 Screenshots
 Features
 About Latest Version
 Awards & Reviews
 User Comments
 Customers
Download
 Download XMLwriter
 Download Plug-ins
 Download Help Manual
 MSXML Updates
 Downloading FAQ
Buy
 Buy XMLwriter
 Pricing
 Upgrading
 Sales Support
 Sales FAQ
Support
 Sales Support
 Technical Support
 Submit a Bug Report
 Feedback & Requests
 Technical FAQ
Resources
 XML Links
 XML Training
 XMLwriter User Tools
 The XML Guide
 XML Book Samples
Wattle Software
 About Us
 Contact Details
Conditonal Section

A way of including or excluding sections in the DTD is to use conditional sections. Conditional sections are of most use when linked to a parameter entity reference, and may only be used in an external DTD subset. The two conditional section statements are IGNORE and INCLUDE.

<![ IGNORE [

markup declarations

]]>

<![ INCLUDE [

markup declarations

]]>

Example:
<!ENTITY % draft "INCLUDE">
<!ENTITY % final "IGNORE">
<![%draft;[
<!ELEMENT book (title,author,summary)>
]]>
<![%final;[
<!ELEMENT book (comments*,title,author,summary)>
]]>
<!ELEMENT comments (#PCDATA)>
<!ELEMENT title (#PCDATA)>
<!ELEMENT author (#PCDATA)>
<!ELEMENT summary (#PCDATA)>

Rules:

  • Conditional sections may only be used in external DTD subsetswell-formedness constraint.
  • Conditional sections must wrap around entire declarationswell-formedness constraint.

Note:

  • The IGNORE declaration takes precedence over INCLUDE. If an IGNORE statement is nested inside an INCLUDE statement, the contents of the IGNORE statement will still be ignored.


XML Guide TOC

XML Declaration
DOCTYPE Declaration & DTDs
ELEMENT Type Declaration
ATTLIST Declaration
ENTITY Declaration
NOTATION Declaration
CDATA Section
Processing Instruction
Conditional Section
Comments

Glossary

© Wattle Software 1998-2017. All rights reserved.