This is a Document Type Declaration
SYSTEM, where the DTD is bound to a specific server or the like.
signatureof the Doctype. If the browser recognizes the signature, it's already downloaded a copy of the rules (also known as the DTD). This is used only for public DTDs.
In Special Characters, I mentioned character entity references, or CERs. With XML-based languages such as XHTML, you can alter the Doctype to create your own. For example, say you're doing a page on chess, and you'd like to use the symbols for chess pieces, which are:
Piece | White | Black | ||
---|---|---|---|---|
Code | Symbol | Code | Symbol | |
Pawn | ♙ | ♙ | ♟ | ♟ |
Knight | ♘ | ♘ | ♞ | ♞ |
Bishop | ♗ | ♗ | ♝ | ♝ |
Rook | ♖ | ♖ | ♜ | ♜ |
Queen | ♕ | ♕ | ♛ | ♛ |
King | ♔ | ♔ | ♚ | ♚ |
So far as I know, there are no CERs for chess symbols; you have to type their respective Numerical Character References. But if you are using XHTML or any other XML-based language, you can creäte them. Suddenly, the Doctype isn't just for validation purposes. So let's assign the following CERs to the symbols.
White | Black | ||
---|---|---|---|
CER | Symbol | CER | Symbol |
&cswp; | ♙ | &csbp; | ♟ |
&cswn; | ♘ | &csbn; | ♞ |
&cswb; | ♗ | &csbb; | ♝ |
&cswr; | ♖ | &csbr; | ♜ |
&cswq; | ♕ | &csbq; | ♛ |
&cswk; | ♔ | &csbk; | ♚ |
Now, remember: this only works when you're using an XML-based language. If the browser is told to treat XHTML as HTML, this won't work. First, create a section in the Doctype that can hold some extra information.
Your custom CERs go between those square brackets; this is basically extending the DTD. Remember the simplified entity I showed in Special Characters? That's how you create these.
<!-- White Pawn -->
<!-- Black Pawn -->
<!-- White Knight -->
<!-- Black Knight -->
<!-- White Bishop -->
<!-- Black Bishop -->
<!-- White Rook -->
<!-- Black Rook -->
<!-- White Queen -->
<!-- Black Queen -->
<!-- White King -->
<!-- Black King -->
Yes, you can put comments in the Doctype. The document will still be valid XHTML 1.0 Strict—valid altered XHTML 1.0 Strict, but valid nonetheless as the new CERs are a part of the extended DTD. The drawback to this is you have to add these to every document you use them in.
So, with all those character entities in place, you can now use the specified references. For example, here's the tbody
of a table showing the various chess symbols:
The result is below:
Just a note—if you use the name of an already-defined CER, the one you write will override what's defined in the DTD.