A declarative markup language, also known as descriptive or semantic markup languages, are varients of a markup language where the language only describes what should appear but doesn’t detail how, leaving that down to the interpreter to define through something like a standard styling pattern or through the use of a secondary styling language.
Technipages Explains Declarative Markup Language (DML)
One example DML is HTML, in the original language, HTML only attaches labels defining what the enclosed text is, e.g. if they’re in the <HEAD> or if they’re in a <BLOCKQUOTE> etc, this leaves it down to the interpreter (the browser in HTML’s case) to decide where to place the elements on the page. Modern HTML(5) differs as it adds new tags that are not entirely declarative in nature such as <i> or <b> which make the enclosed text italic and bold respectively.
XML (eXtensible Markup Language) is a prime example of a DML. In XML all content is sorted into tags which are purely descriptive, in some implementations the names for tags may have meanings but those meanings are purely for human readability. XML is intended to be as flexible as possible with regards to naming, the standard itself poses no naming limits at all and is meant to be a framework for a language to be built around, as such XML is ideal for use in APIs.
Common Uses of Declarative Markup Language (DML)
- A declarative markup language may also be known as a descriptive or semantic markup language.
- Declarative markup languages are used to label parts of the document rather than to provide specific instructions as to how they should be processed.
- Declarative markup languages encourage authors to write in a way that describes the material conceptually, rather than visually.
Common Misuses of Declarative Markup Language (DML)
- Declarative markup language is a longer term for markup languages.