DTD

A Document Type Definition ( DTD) is a set of declarations that describe the structure of a type of XML documents . Serna comes with DTDs for supported popular document types. You can also develop your own DTDs. DTDs are sometimes required by the XML parser on opening a document and may contain important internal or external entity declarations and #ID/ #IDREF attribute declarations.

A DTD is associated with an XML document by means of a Document Type Declaration ( DOCTYPE). DOCTYPE is a tag at the beginning of an XML document that establishes that the document is an instance of the type defined by the referenced DTD.

The declarations in a DTD are divided into an internal subset and an external subset:
  1. The external declarations are located in a separate file.

    The external subset may be referenced via a public identifier (PUBID) and/or a system identifier (SYSID) in the Document Type Declaration.

    For example, in the following Document Type Declaration, the public identifier is "-//OASIS//DTD DITA Concept//EN" and the system identifier is "concept.dtd":
    <!DOCTYPE concept PUBLIC "-//OASIS//DTD DITA Concept//EN" "concept.dtd" []>
  2. The internal declarations are embedded in the Document Type Declaration in the XML document itself.

    For example, the following Document Type Declaration contains an internal subset consisting of the entity declaration [ <!ENTITY abc 'abc'>] :
    <!DOCTYPE article PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN" "docbookV4.5/docbookx.dtd" [
    <!ENTITY abc 'abc'>]>

See also information about DTD on W3C.

In Serna, when you create a new document with a Serna document template, a corresponding DTD prescribed by the template is applied automatically. You can also assign the path to some DTD other than that prescribed by the selected template.

When loading a document that has nonempty DTD SYSID, Serna tries to find and parse the DTD. To locate the DTD and XML entities, Serna uses XML catalogs and/or DTD search paths.

You can see what DTD is currently applied to your document.

Related concepts
XSL Stylesheet
XML Schema
XML Catalogs