Glossary · 4 · Structure and semantics
Semantic markup
Also known as: Descriptive markup, Meaningful markup
German: semantisches Markup
In structured authoring and web publishing, semantic markup is markup that names what a piece of content is or means — for example a parameter, a hazard, a part number, a command or a list — rather than how it should look, so that its presentation is decided separately and software can process the content by its meaning.
- Markup
- Semantics
- Structured authoring
In one sentence
Semantic markup names what content is, such as a parameter, a hazard or a part number, rather than how it looks, so software can process it by meaning.
Example
Instead of setting “80 Nm” in bold, the source marks it as a torque value for a named bolt connection; the stylesheet formats it, and a check can compare it with the value in the engineering data.
How it applies
- Principle: Semantic markup separates what content is from how it is presented. The HTML standard states the principle for the web: elements, attributes and attribute values have defined meanings — the
olelement represents an ordered list, thelangattribute the language of the content. In technical documentation the same idea underlies SGML, XML vocabularies and the schemas that define them. - Degrees of meaning: Markup can be semantic at different levels. Marking a text as a list or a step names a document structure; marking it as a hazard, a torque value or an error code names the subject matter. Mark Baker distinguishes these as document-domain and subject-domain markup. DITA elements such as
hazardstatement(see DITA hazard statement) orcmdnamecarry meaning beyond appearance. - In documentation practice: Semantic markup lets one source be formatted differently for print, web and mobile, lets editors and schema validation check structure, enables reuse and filtering, and gives search and retrieval systems typed content. It is the basis of semantic documentation together with metadata.
- Limits: Markup records what the author declared; a value marked up as a torque value is not thereby correct. Semantic markup does not make documentation compliant or a product safe.
Semantic markup vs. presentational markup
Presentational markup records appearance — bold, italic, font size, a red box. Semantic markup records meaning, and appearance is assigned by a stylesheet. A red box around a warning is presentation; a warning element with a signal word and a consequence is semantic and can be rendered as a red box, spoken aloud or checked for completeness.
External references
- WHATWG, HTML Living Standard, section 3.2.1 “Semantics”: https://html.spec.whatwg.org/multipage/dom.html
- W3C, Extensible Markup Language (XML) 1.0: https://www.w3.org/TR/xml/