Schema Documentation - DIAGRAM Description Profile
version 1.0

The block element

On this page:

The block element establishes an association between a group of elements.

The block element differs and is subordinate to the section element in that it is not used to represent the structural outline of a document. A block only establishes a general association, and is a semantically neutral element by default.

Attributes attached to the block reflect a general commonality amongst the children: a role attribute can be attached to express the semantic nature of the grouping; a class attribute to establish common formatting; an xml:lang attribute to indicate the language of the elements; and so forth.

If the children of the block have a strong association to a single element, the associate attribute can be used to make this relationship explicit (e.g., in a figure, that all children are connected to the image).

Usage Example

<block xml:space="preserve" role="letter">
    <ln>Alice's Right Foot, Esq.</ln>
    <ln>    Hearthrug,</ln>
    <ln>        Near the fender,</ln>
    <ln>            (with Alice's love).</ln>
</block>
    

Allowed parents

annotation, m:annotation-xml, aside, block, caption, code, description, item, d:longdesc, note (block variant), note (phrase variant), object, quote, section, d:simplifiedLanguageDescription, d:summary, td, th and d:tour

Allowed children

This element may contain text.

This element may contain the following children: abbr, annoref, annotation (block variant), annotation (phrase variant), aside, block, ssml:break, caption, char, citation (block variant), citation (phrase variant), code (block variant), code (phrase variant), d, definition, description, d:description, emph (text variant), emph (phrase variant), expansion, hd, rend:linebreak, list, ln, m:math, name, note (block variant), note (phrase variant), noteref, num, object (block variant), object (text variant), object (phrase variant), p, pagebreak, ssml:phoneme (text variant), ssml:phoneme (phrase variant), ssml:prosody (text variant), ssml:prosody (phrase variant), quote (block variant), quote (phrase variant), ref, its:ruby, s, ssml:say-as (text variant), ssml:say-as (phrase variant), span (text variant), span (phrase variant), sub, ssml:sub (text variant), ssml:sub (phrase variant), sup, table, term, time, ssml:token (text variant), ssml:token (phrase variant), verse and w

Content model and additional requirements

a choice of
either one or more of
end of choice
Note that in addition to restrictions presented in the content model above, use of this element must also respect the following requirement:
  • The block element must neither be empty nor contain only whitespace.
Such requirements take precedence over any conflicting statements in the content model or in the lists above of allowed children and parents.

Namespace

http://www.daisy.org/ns/z3998/authoring/

Usage Details

Associated content

Although images, tables and other objects may stand on their own in a document, typically they will include an accessible description, a caption and possibly a header.

In order to establish that other elements are carrying information about the table or image, you must tie them together using ref attributes that point to the xml:id of the central element, as in the following example:

<hd ref="galapisle">Galapagos Islands</hd>

<object xml:id="galapisle" src="island.png" />

<caption ref="galapisle">The Galapagos islands lie approximately 970km off the shore of Ecuador.</caption>
        

If you were to omit the ref attributes, the information would only be loosely associated by its order in the document (i.e., a processing agent would not be able to handle the elements as a group).

Although all of the above elements are associated through references to the object element, their semantics are still only loosely defined (i.e., the linkage is established, but not what that linkage represents). A human can intuit they represent a figure by the collected items and their use, but not so a machine.

It can also be confusing to edit a document marked up with all content within a section as siblings, because document narrative could fall both immediately before and after the figure elements making it all appear connected. Without checking for ref attributes as you edit, it wouldn't be clear if a new non-structural heading were occuring or a figure were being inserted.

To begin to bind the elements more tightly and create a figure both humans and machines can understand, the block element can be wrapped as a container. A role attribute can then be attached to further specify that all of the children constitute a figure, as in the following example:

<block role="figure">
    
    <hd ref="galapisland">Galapagos Islands</hd>
    
    <object xml:id="galapisland" src="island.png" />
    
    <caption ref="galapisland">The Galapagos islands lie approximately 970km off the shore of Ecuador.</caption>
    
</block>
        

A common question at this point is why the ref elements are still necessary. The answer is because the block element is only a general container. The role attribute provides additional semantics, but those semantics only extend to what kind of content the block represents, not how it is interrelated (but more on this shortly).

Now that the content is grouped, however, we can begin to further simplify it. To avoid the extra work of linking the child elements, an associate attribute can be attached to the block (the attribute represents an automatic ref between all the children). The IDREF that you specify in the attribute implicitly makes the references that we have so far been carrying forward, so our markup can now be more minimally represented as in the following example:

<block role="figure" associate="galap-figure">
    
    <hd>Galapagos Islands</hd>
    
    <object xml:id="galap-figure" src="island.png" />
    
    <caption>The Galapagos islands lie approximately 970km off the shore of Ecuador.</caption>
    
</block>
        

Now, when a processing agent comes across this markup it will be able to determine both that the block constitutes a figure (from the role attribute) and that the child hd and caption elements are tied to the object (from the associate attribute). We've gained much more information about the figure than we started with, and the work required to reproduce the figure has been greatly simplified (there is also no worry about accidentally forgetting a ref on any of the children).

Now that we have a compact markup model for figures, we can briefly jump back to why we cannot assume associations. Consider the following example:

<block role="figure">
    
    <object xml:id="galap-isa" src="isabella.png" />
    
    <object xml:id="galap-fer" src="fernandina.png" />
    
    <object xml:id="galap-sc" src="santa-cruz.png" />
    
    <caption>The Galapagos islands lie approximately 970km off the shore of Ecuador.</caption>
    
</block>
        

We cannot make a simple association here that all the children of the figure are tied to an object, as the figure constitutes three images sharing a caption. We likewise cannot use the associate attribute, but have to revert back to explicitly linking the caption to each of the three images it describes:

<block role="figure">
    
    <object xml:id="isa" src="isabella.png" />
    
    <object xml:id="fer" src="fernandina.png" />
    
    <object xml:id="sc" src="santa-cruz.png" />
    
    <caption ref="isa fer sc">The Galapagos islands lie approximately 970km off the shore of Ecuador.</caption>
    
</block>
        

It's this potential for varation that requires at least some level of linking in all cases, and makes it impossible to state a simple rule that would hold true for all content grouped in a block.

Fortunately, most image and table figures are not this complicated, and the simpler process of grouping in a block with the associate attribute will work the majority of the time.