Chapter 6. Cross-referencing

There are many data sets in UDDF which can be reused in different parts of a file. For example, the data for dive spots, buddies, and equipment need to be given only once in a global part. If a person is set as buddy for a specific dive, these data need not to be given a second time, but a cross-reference is made to the global data set.

Since version 3.0.0 there is the special element <link/> which is used for cross-referencing. This element has an attribute "ref" which is the ID of the data set to be cross-referenced. The following example illustrates this:

<diver>
    <buddy id="buddy_Alfons">
        <personal>
            <firstname>Alfons</firstname>
            ...
        </personal>
        ...
    </buddy>
    <buddy id="buddy_Berta">
        <personal>
            <firstname>Berta</firstname>
            ...
        </personal>
        ...
    </buddy>
    <!-- here descriptions of further dive buddies -->
</diver>
<profiledata>
    <repetitiongroup id="rg1">
        <dive id="dive1">
            <divenumber>1</divenumber>
            ...
            <link ref="buddy_Alfons"/>
            ...
        </dive>
        <dive id="dive2">
            <divenumber>2</divenumber>
            ...
            <link ref="buddy_Berta"/>
            ...
        </dive>
        <dive id="dive3">
            <divenumber>3</divenumber>
            ...
            <link ref="buddy_Alfons"/>
            ...
        </dive>
        ...
    </repetitiongroup>
</profiledata>
            

In the above example is set that the diver with ID buddy_Alfons was buddy in dives 1, and 3 respectively. The diver buddy_Berta was buddy during dive No. 2.

Each element for which an ID has to be set as an attribute can be cross-referenced — as often as necessary, of course.

The ID of an element has to be unique within an UDDF file. Furthermore, if possible, it should be globally unique. For the sake of better human readability the ID should begin with its element type followed by a unique series of characters generated from the key data of the element.

Allowed characters are all alpha-numeric characters — i.e. "a" through "z", "A" through "Z", "0" through "9" — as well as underscore "_", hyphen "-", and dot ".". Not allowed are spaces " ", numbers and dots at the beginning, and all other not mentioned punctuation marks (for example all bracket signs, Dollar sign, tilde etc.).

In the following some recommendations, and suggestions respectively, for the generation of IDs are given (designators in square brackets are optional):

Thus, the following IDs are possible, e.g.: