Conditional Sections

[Previous] [Next]

The XML specification defines conditional sections of your DTD so that you can decide to include or exclude portions of your DTD. The conditional sections can occur only in the external subset of the DTD and in those external entities referenced from the internal subset. The syntax is shown here:

 <![ INCLUDE [ <!--The declarations you want to include-->  ]]> <![ IGNORE [ <!--The declarations you want to ignore-->  ]]> 

If you combine these conditional sections with parameter entities, you will have a way to include and exclude blocks of text by changing the values of the parameter entities. For example, if you wanted to include declarations that could be used for debugging your application, you could add the following declaration:

 <!ENTITY % debug "INCLUDE"> <![ %debug; [ <!--Debugging code here --> ]]> 

You could turn debugging off by changing the entity declaration as follows:

 <!ENTITY % debug "IGNORE"> 



Developing XML Solutions
Developing XML Solutions (DV-MPS General)
ISBN: 0735607966
EAN: 2147483647
Year: 2000
Pages: 115
Authors: Jake Sturm

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net