io7m | single-page | multi-page | xstructural 2.2.0-SNAPSHOT
1.1. Description
Previous
1. Language
Up
1.3. Metadata
Next

# 1.2. Document

- 1.2.1. Description
- 1.2.2. Tables Of Content
- 1.2.3. Identities
- 1.2.4. Links
- 1.2.5. Types
- 1.2.6. Examples

## 1.2.1. Description

1
The Document element describes the top-level structure of a document. A document consists of metadata, and a set of top-level sections or subsections (but not both).
2
A Document must carry a schema version declaration that indicates to which version of the structural language the document is expected to conform. This is achieved with the use of an xmlns attribute on the Document element. The currently published language versions are:

### 1.2.1.3. Language Versions

Language | Identifier
--- | ---
Structural 7.0 | urn:com.io7m.structural:7:0
Structural 8.0 | urn:com.io7m.structural:8:0

## 1.2.2. Tables Of Content

1
Renderers encountering a Document element will typically generate a table of contents for the entire document. The tableOfContentsDepth attribute on the Document instructs renderers as to how far into the list of sections or subsections the rendering algorithm should recurse in order to generate the table of contents. For example, an author may choose to only include top-level Section elements in the table of contents and would therefore specify tableOfContentsDepth="1".

## 1.2.3. Identities

1
Many elements within a Document may be assigned unique identifiers. A unique identifier is a UUID value specified using the id attribute. It is possible to then link to those elements from within the document text using the Link element, and the schema will guarantee the integrity of internal links at validation time.

## 1.2.4. Links

1
As described in the Identities section, many significant elements in a document may be the target of the Link element. The structural language distinguishes between different types of links in order to apply varying degrees of integrity checking, and to allow renderers to render links differently based on types. The following kinds of links are currently supported:

### 1.2.4.2. Link Types

- Link - a link to a document element. Subject to integrity checks at validation time.
- LinkExternal - a link to an external document such as a web site. Not subject to integrity checks.
- LinkFootnote - a link to a footnote. Subject to integrity checks at validation time.

## 1.2.5. Types

1
Most elements within documents allow for the specification of type attributes. The type attribute is used to add semantic tags to elements that can be interpreted by renderers in various ways. Typically, the type attribute is translated directly to a CSS class. The attributes can also be consumed by document processors that are trying to extract other semantic information from documents. For example, in this documentation, the term xstructural is always expressed as a Term element with a type attribute set to package. This is intended to indicate to a document processor that the term means "a software package named xstructural". Document authors that are not interested in semantic information can use the type attribute purely for formatting, or alternatively can ignore it entirely.

## 1.2.6. Examples

### 1.2.6.1. Document Example

    <Document xmlns="urn:com.io7m.structural:8:0" tableOfContentsDepth="2" id="14ab90da-7947-420c-a5f8-d9c9c87fbddc">
      ...
    </Document>

1.1. Description
Previous
1. Language
Up
1.3. Metadata
Next
io7m | single-page | multi-page | xstructural 2.2.0-SNAPSHOT