Combined DTD
You can use both an internal DTD and an external one at the same time. This could be useful if you need to adhere to a common DTD, but also need to define your own definitions locally.
Example
This is an example of using both an external DTD and an internal one for the same XML document. The external DTD resides in tutorials.dtd and is called first in the DOCTYPE
declaration. The internal DTD follows the external one but still resides within the DOCTYPE
declaration:
Here, I've added a new element called summary
. This element must be present under the tutorial
element. Because this element hasn't been defined in the external DTD, I need to define it internally. Once again, we're setting the standalone
attribute to no
because we rely on an external resource.