Next / Previous / Contents / Shipman's homepage

5.5.  The loc element: Defining location codes

Each location code used in a day's notes must be defined in a loc element. These location codes are used in several places:

loc = element loc
{   attribute code { xsd:Name },  1
    attribute name { text },      2
    gps*,                         3
    text?                         4

The code attribute gives the code being defined. We use the XSchema “ID” datatype because this element defines this location code as a unique identifier so that other attributes can refer to it. It must be a valid XML name, starting with a letter and consisting only of letters, digits, underbar, period, and colon. Example:


Originally, this field was defined as a unique identifier of type xsd:ID. However, this won't work, because ID values must be unique within a file, and in our case they must be unique only within a day-notes element. This problem was caught by the xmllint verifier using the Relax NG version of this schema:

xmllint --noout --relaxng birdnotes.rng 200705.xml


The name attribute gives the ordinary name of that location. For more discussion of the format of the name, see Section 3.2, “The spatial dimension”. Example:

    name='Bosque del Apache NWR: Headquarters'


If there are GPS waypoints relevant to this location, gps elements can be included inside the loc element; see Section 5.6, “ The gps element: defining a waypoint ”.


Following any gps element children, you can include arbitrary text as necessary to describe other relevant information such as directions for getting there, comments on habitat change, local names, etc.