Next Previous Contents

5. 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.

The element name of the cross-reference is composed of the element name itself plus a suffix "ref". 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 other buddies -->
    </diver>
    <profiledata>
        <repetitiongroup>
            <dive id="dive1">
                <divenumber>1</divenumber>
                ...
                <buddyref ref="buddy_Alfons">
                ...
            </dive>
            <dive id="dive2">
                <divenumber>2</divenumber>
                ...
                <buddyref ref="buddy_Berta">
                ...
            </dive>
            <dive id="dive3">
                <divenumber>3</divenumber>
                ...
                <buddyref 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.

In the following some recommendations, and suggestions respectively, for the generation of IDs are given (designators in square brackets are optional) (for better human readability underscores "_" can be inserted):

With it the following IDs are possible, e.g.:


Next Previous Contents