SMASHDOCs XML Documentation

Basic skeleton

The basic skeleton of a SMASHDOCs-xml consists of the smashdoc-element, which contains the document-element.

All text, image and table sections are appended to the document-node.

The DTD can be downloaded here: sdxml.dtd (Please note that your browser will probably not display the dtd, please use “link save as”)

Example:

<?xml version='1.0' encoding='utf-8'?>
<smashdoc>
  <document>
    <paragraph>this is text</paragraph>
  </document>
</smashdoc>

Elements in document node

Paragraph

A normal text paragraph can be created with the <paragraph>-element.

Example:

<paragraph>normal text section</paragraph>

Heading

A heading without numbering can be created with the heading-element with @level-attribute, which determines the heading level (integer between 0 and 5).

Example:

<heading level="0">this is a heading</heading>

Numbered Heading

The heading-element with @enumeration-attribute creates a numbered heading. @enumeration sets the numbering level (integer between 0 and 5).

Example:

<heading enumeration="0">a</heading>

Numbered Paragraph

A paragraph with numbering can be created with a paragraph-element with @enumeration-attribute.

@enumeration sets the numbering level, according to the enumerated heading (integer between 0 and 5).

Example:

<paragraph enumeration="1">b</paragraph>

List

Lists are represented as nested structure in SMASHDOCs-xml.

A single list entry is created with a li-element. The li has to be child of a ol-element and can have other li-s as sibling elements

The top element of the list is ol. It can contain li-elements and other ol-elements. To this top ol-element, a @indent-attribute can be attached, which indents the whole list.

The first child of a ol always has to be a li.

Example:

<ol indent="1">
  <li>this</li>
  <ol>
    <li>is</li>
    <li>a</li>
  </ol>
  <li>nested</li>
  <ol>
    <li>list</li>
    <li>with</li>
    <li>several</li>
    <li>entries <a href="http://myurl.com">My Link</a></li>
  </ol>
</ol>

Ordered List

Ordered Lists are represented as nested structure in SMASHDOCs-xml.

A single list entry is created with a li-element. The li has to be child of a ul-element and can have other li-s as sibling elements

The top element of the ordered list is ul. It can contain li-elements and other ul-elements. To this top ul-element, a @indent-attribute can be attached, which indents the whole list.

The first child of a ul always has to be a li.

Example:

<ul indent="1">
  <li>this</li>
  <ul>
    <li>is</li>
    <li>a</li>
  </ul>
  <li>nested</li>
  <ul>
    <li>list</li>
    <li>with</li>
    <li>several</li>
    <li>entries <a href="http://myurl.com">My Link</a></li>
  </ul>
</ul>

Image

An image can be inserted with the image-element.

The text-node contains the filename.

The width, caption and whether numbering is enabled can be set via the attributes width, caption and num-enabled.

Example:

<image width="57%" caption="Deutsches Museum München" num-enabled="1">myimage.jpeg</image>

Table

A table can be inserted with the table-element.

First child of table is the column_width-element, which itself contains an item for each column. These items contain the percentage of width for each column.

Furthermore, the table contains tr elements that contain td or th cells.

The width, caption and whether numbering is enabled can be set via the attributes width, caption and num-enabled.

Example:

<table indent="0" caption="my table title" width="47.0%" num-enabled="1" border-color="#cccc00">
  <column_width>
    <item>33.33%</item>
    <item>33.33%</item>
    <item>33.33%</item>
  </column_width>
  <tr>
    <th>a</th>
    <th/>
    <th/>
  </tr>
  <tr>
    <th/>
    <td>b</td>
    <td/>
  </tr>
  <tr>
    <th/>
    <td/>
    <td>c</td>
  </tr>
</table>

Styling:

For the whole table the color of the cell-borders can be set via @border-color.

The height of a table-row can be set via the attribute @min-height (unit px) for the element tr.

The borders of each cell can be set with the attributes @border-bottom @border-right @border-top and @border-left.

@text-align and @vertical-align is possible to set for each cell.

Inside a table cell b, i, u and strike elements can be used for inline styling. font with @size (unit px) can be used for the font-size. In the current version, all inline style-tags in a table cell will be applied for the whole table cell.

Example:

<tr min-height="47px">
    <th text-align="center" vertical-align="middle" border-bottom="1">This is the content of a table header field</th>
    <td><b><i><u><strike><font size="12px">This is the content of normal table cell</font></strike></u></i></b></td>
</tr>

Pagebreak

Pagebreaks are supported with the empty pagebreak-element.

<pagebreak/>

Attributes

General section attributes

@alignment possible values are “left”, “center”, “right” and “justify”
@id possible is any CDATA, needed when xref is used
@indent specifies the indent level for this section. Possible are 0 (standard), 1, 2, 3, 4, 5

Attributes for Headings and numbered Paragraphs

@enumeration Possible for the elements heading and paragraph. When used with heading the result will be a numbered heading. When used with paragraph, the result will be a numbered paragraph. The value sets the level of numbering. Valid values are 0, 1, 2, 3, 4, 5.
@level Can be used with the element heading. Sets the heading level. Valid values are 0, 1, 2, 3, 4, 5.

Attributes for images and tables

The following attributes can be used for the elements image and table.

The width can be set with @width in %.

@num-enabled can be set to 0 or 1. It sets, whether a image or table will have a counter below.

@caption is a text that will be shown below the image or table.

Possible Content in Text Sections

#PCDATA

Heading elements can contain only #PCDATA.

Example:

<heading>This is a heading.</heading>

Mixed Content

Paragraph and List elements can contain #PCDATA and some additional elements.

Styling Elements

To style the words, it’s possible to make them bold, italic, underlined, superscripted and subscripted. This is realized via the elements b, i, u, sub and sup. A style-tag can of course contain other style-tags. Only sub and sup cannot contain each other.

Cross-Reference

To create a Cross-Reference, a xref-tag can be used.

The target of the Cross-Reference is set via the @href-attribute. Possible targets are: Headings, Numbered Paragraphs, Images and Tables. The target element has to contain the according @id-attribute.

For setting the mode of how the cross-reference is displayed, there are two attributes:

@data-num-enabled (can be 0 or 1) sets, whether the number of the target is displayed. The displayed number can be a heading or paragraph number like “1.4.3” or in case of an image “image 2”.

@data-content-enabled (can be 0 or 1) sets, whether the content of the target is displayed. The displayed content is the whole content of a heading or numbered paragraph or the caption of a table or image.

At least one of these attributes has to be 1 for a valid cross-reference.

Example:

<heading enumeration="0" id="65b8b6aa-227e-e1ba-66f0-bd1ccf18f0cf">My Heading</heading>
<paragraph enumeration="1" id="3ff3ea40-a0f4-4f19-d66e-05268c122a98">This is a numbered paragraph</paragraph>
<paragraph enumeration="1" id="d2d2804c-d7d5-b1c0-fb32-49addd640ef8">In paragraph <xref href="3ff3ea40-a0f4-4f19-d66e-05268c122a98" data-num-enabled="1" data-content-enabled="0"/> the assumption is proved.</paragraph>

Footnote

A footnote can be created via the empty footnote-tag. The footnote text is set via the @data-content-attribute.

Example:

<paragraph>This is text. <footnote data-content="This is my footnote-text."/></paragraph>