## PhotoML: Photo Description Markup Language

### Brendt Wohlberg

`<photoml@wohlberg.net>`

Revision History
Revision 0.08 | 13 November 2010
Revision 0.07 | 22 November 2007
Revision 0.06 | 8 June 2007
Revision 0.05 | 20 August 2005
Revision 0.04 | 18 November 2004
Revision 0.03 | 31 January 2004

## Purpose

This distribution is primarily intended to provide a format (defined by the PhotoML DTD) and tools for describing details of photo creation, processing, and content in a collection of photographs. It is designed to be appropriate for a wide variety of photographic formats, including roll film (such as 35mm and 120/220), sheet film (such as 4x5 and 8x10) and digital images. The type of information represented, while allowing description of details of content, creation etc. for digital images, does not support some of the more low-level housekeeping details that might be necessary in an application such as an online database of digital images. In particular, PhotoML is not yet another web photo gallery generator.

### Alternative Formats

While alternatives exist, none of them seem to completely fit the role for which PhotoML was designed. Photo RDF has significantly lower complexity than PhotoML, allowing representation of a much smaller set of information, and does not provide any of the photo grouping mechanisms which seem desirable when describing a large collection of photos. DIG35 has higher complexity than PhotoML in some respects, providing support for greater detail for individual images. Since DIG35 is designed as metadata to be attached in the header of a digital image, it also lacks the image grouping facilities of PhotoML, and while DIG35 is intended to become an industry standard, the schema is not completely freely distributed (available on request only, but free for government and educational use).

### Further Development

PhotoML has received a substantial amount of work, but a number of rough edges still require attention. Comments, suggestions, and contributions (including any involving significant changes) are welcome, and should be directed to `<photoml@wohlberg.net>`. There are no immediate plans for a transition from the DTD to an XML Schema as the primary format definition (in contrast to DTDs, there does not yet seem to be much free software supporting editing and validation of schemas), but example schemas auto-generated from the DTD are included in the distribution.

## The Distribution

The distribution consists of XML document type definitions, XSLT stylesheets for generating HTML formatted versions of the photo description XML, and various software tools. Note that the name PhotoML is used to describe the XML format defined by the PhotoML DTD as well as the entire distribution; the intended meaning should be clear from the context in which the name is used.

### License

Use of this distribution is subject to the terms of the GNU General Public License (version 2), a copy of which is included in the distribution. If anyone wishing to use this distribution finds the GPL too restrictive, I will consider requests to make it available under an alternative open source license.

### Platforms

The primary content of the `dtd`, `xsd`, `xsl`, and `xml` directories should be platform independent, but the configuration and installation files require a UNIX environment. The scripts in the `tools` directory have been tested under Linux on an i386 architecture, but should work on any UNIX platform with recent versions of libxml2 and libxslt installed. MS Windows versions of the utility scripts are not currently available, but should be easily ported from shell script to a scripting language available on that platform. Windows users may, however, wish to try installing under the cygwin environment.

### Prerequisites

The primary prerequisites, other than basic UNIX shell utilities, are perl, and the libxml2 and libxslt packages. Some of the tools have additional requirements:

md5sum | Standard on many Linux systems.
dcraw | Available as source, RPM and deb packages.
imageinfo | Source, SRPM and Ubuntu source deb packages available.
xgrep | Source, SRPM and Ubuntu source deb packages available.
Date::Manip | Perl module available from CPAN.
Image::ExifTool | Perl module available from CPAN.

### Installation

The source distribution is available from the PhotoML download page. After unpacking the tar archive, the simplest installation procedure consists of the following commands (executed from the distribution root directory):

         ./configure
          make
          make test
          make install

The final `make install` usually needs to be performed with root privileges (see the INSTALL file for further details). Using the default configuration, software tools are installed in `/usr/local/bin`, and the DTD, XSL, and associated files are installed in `/usr/local/share/photoml`.

Users of Red Hat/Fedora or Ubuntu Linux may install the RPM or deb packages available from the PhotoML download page. When installing from RPM or deb packages, software tools are installed in `/usr/bin`, and the DTD, XSL, and associated files are installed in `/usr/share/photoml`.

### Distribution Content

The distribution content is divided up into a number of subdirectories, as described below.

#### DTD

The `dtd` directory contains the PhotoML DTD and associated files (character set defining external entities) and a catalogue file which is used by libxml2 tools for locating DTDs. The PhotoML DTD defines the primary XML format for describing collections of photographs, and, while still under development, should be reasonably stable. When the DTD is changed, the pmlupgrade utility provides automatic (or semi-automatic, in complex cases) conversion to the new format.

#### XSL

The `xsl` directory contains XSLT stylesheets for constructing HTML views of PhotoML XML files (in the `xsl/html` directory), for expansion of defaults elements (in the `xsl/defaults` directory), for upgrading PhotoML XML files from older DTD versions (in the `xsl/upgrade` directory), and for supporting the functionality of some of the tools (in the `xsl/misc` directory).

#### XML

The `xml` directory contains XML examples of PhotoML photo description and image description files. The top level `make` command builds HTML views of these files using the XSLT stylesheets in the `xsl` directory.

#### Tools

The `tools` directory contains tools for expanding defaults in PhotoML files, validating PhotoML files, constructing HTML representations etc.:

pmlcreate | Generate PhotoML roll description outline
pmldigital | Generate PhotoML descriptions of digital images from digital cameras and film scanners
pmlexpand | Expand and remove defaults in a PhotoML XML file
pmlgrep | Provides a grep-like utility for PhotoML files
pmlindex | Constructs an HTML index of PhotoML files
pmltrans | Transform a PhotoML XML file using the standard PhotoML XSL style sheet
pmltoxmp | Transform PhotoML data to XMP format
pmlupgrade | Upgrade PhotoML XML files to latest DTD version
pmlvalid | Validate PhotoML XML files

Further details are provided in the man pages in that directory. Installation of libxml2 and libxslt is required, as the scripts in this directory make use of the xmllint and xsltproc utilities.

#### Documentation

Suprisingly enough, the `docs` directory contains documentation; the main document source in DocBook format, and viewable documents in HTML, PDF, and text formats.

#### XSD

The `xsd` directory contains an XML Schema definition that has been auto-generated from the PhotoML DTD by trang. While this schema may be useful to those wishing to use schema based XML tools, it has not been verified to be correct, and should not be considered as the primary document type definition.

## Using PhotoML

At least some familiarity with XML is probably necessary to make use of PhotoML. It is particularly important for users who are not familiar with DTD syntax to use an XML editor (see Appendix A, XML Editing Tools) that provides DTD guided context-dependent element insertion to ensure that valid documents are created.

The recommended formal public identifier for the current version of the PhotoML DTD is

    "-//BW//DTD PhotoML 0.13//EN"

A PhotoML XML file will therefore usually begin with the following two lines

    <?xml version="1.0">
    <!DOCTYPE photo PUBLIC "-//BW//DTD PhotoML 0.13//EN" "photo.dtd">

It is important to use the full public identifier including the DTD version number so that the version upgrade script is able to correctly identify the relevant DTD version when transitioning to a new DTD.

### The PhotoML DTD

PhotoML is a very flexible format, providing facilities for recording far more detail than is likely to be of interest to the average photographer. A reasonable introduction to the format can be obtained by inspecting the example files in the `xml` directory, and viewing the corresponding HTML views generated by the XSLT stylesheets. For those who are familiar with DTD syntax, see Appendix B, PhotoML DTD or read through the heavily commented DTD in the `dtd` directory. A few issues are sufficiently complex to warrant additional discussion.

#### Collections

The id attribute of roll, sheet, and digital elements is intended to assign the primary identity for the group. If the group contains a collection element, the cgid attribute represents a secondary identity for the group relative to the collection, the identity of which is determined by the id attribute of the collection element. The fstid and lsid attributes specify the first and last frame identities which are contained in the the collection, so that it may contain only part of the group. A group may also contain multiple collection elements.

#### The frame id and fn attributes

The id attribute is intended to assign the primary identity for the frame. It is recommended that the values be two digit numbers, increasing in chronological frame order (e.g. 01 for the first frame exposed, 02 for the second frame exposed etc.). If the actual frame number marked on the film differs from the id, it may be recorded using the fn attribute, which is also useful in other situations, e.g. when the camera exposes film beginning at the end, so that the id numbers increase in chronological order, while the fn values decrease.

#### The xml:lang attribute

The xml:lang attribute, available for relevant elements, is a standard mechanism for specifying the language of the element content. In addition to the definition in the XML standard, relevant information is available in the documents describing rfc3066 and iso639-2.

#### The date element

The date element has the format `YYYY`[-`MM`[-`DD`]], (that is, `YYYY`-`MM`-`DD`, `YYYY`-`MM`, or `YYYY`).

#### The time element

The time element (using the 24 hour clock) has the format `hh`[:`mm`[:`ss`[.`ss`*]]] (that is, `hh`, `hh`:`mm`, `hh`:`mm`:`ss`, or `hh`:`mm`:`ss.s` with an arbitrary number of fractional seconds after the decimal point).

The optional zone attribute represents the UTC time zone in the format (+|-)`hh`[:`mm`] (that is +`hh`:`mm`, -`hh`:`mm`, +`hh`, or -`hh`).

For further details see a comprehensive discussion of ISO time notation, upon which these restrictions are based.

#### The digimage element

The digimage element is intended to provide a mechanism for describing digital images, primarily images from digital cameras, from film scanners, and edited digital images. Note that this format complements the primary PhotoML digital element for images from digital images. For example, each image captured using a digital camera is both a photograph (relevant aspects of which, such as creation date, location, scene description etc. are described using digital elements and their frame children) and a digital image (relevant aspects of which, such as image geometry, bit depth, image format etc. are described using digimage elements).

#### The defaults element

Elements contained within a defaults element provide default values for the subsequent entities in which the relevant elements have not been specified (for example, sub-elements of a frame specified within a defaults element are considered implied markup within any subsequent frame for which those sub-elements are not explicitly specified. An expanded version of a PhotoML file, with all defaults elements explicitly merged into the relevant elements, may be obtained by using the pmlexpand utility.

An understanding of the rules governing defaults elements is necessary for using them appropriately. The ruling defaults at any point in a PhotoML document are obtained by combining (as discussed below) all preceding defaults elements at higher levels in the element tree, and preceding defaults elements which are also children of the current parent node (the scope of a defaults element is defined by its parent element). For example, within the following document

     <photo>
       <defaults> ... A  ... </defaults>
       <roll>
         <defaults> ... B ... </defaults>
         <frame>
           ... 1 ...
         </frame>
       </roll>
       <roll>
         <frame>
           ... 2 ...
         </frame>
       </roll>
     </photo>

defaults A and B apply to frame 1, but only defaults A apply to frame 2.

The current defaults at any point in the document are obtained by combining all preceding relevant (those within the current scope) defaults. As each defaults element is encountered in document order, a new current defaults set is constructed by combining the newly encountered defaults element with the current set in the manner specified by the combine attribute of the newly encountered defaults element. (A new copy of the current set is created when an inner scope is encountered so that any modifications to the current set within that scope do not effect the outer scope.) The possible values of the combine attribute are (the default attribute value is `merge`):

`replace`

  The current defaults are deleted and replaced by the content of a defaults element with a value of `replace` for its combine attribute.

`merge`

  The defaults element with a value of `merge` for its combine attribute is merged over the current defaults in the sense that any elements not in the current defaults are inserted, and any terminal node elements in both are replaced by those in the defaults element.

The processing instruction `<?merge-reject` element-name element-name ... `@`attribute-name `@`attribute-name ... `?>` may be used to signal the removal of an element during a subtree merge, as illustrated in the following example

     <photo>
       <roll>

         <defaults>
           <frame>
             <scene>
               <occasion>
    	     <date>2000-01-01</date>
                 <time zone='+02:00'>12:30</time>
    	   </occasion>
               <location>
                 <country>country-name</country>
                 <city>city-name</city>
               </location>
             </scene>
           </frame>
         </defaults>

         <frame id='01'>
           <scene>
             <occasion>
               <time>
                 <?merge-reject @zone?>
               </time>
             </occasion>
             <location>
               <?merge-reject city?>
             </location>
           </scene>
         </frame>

       </roll>
     </photo>

where defaults expansion results in the frame with id='01' having the defaults content merged in, with the exception of the attribute zone and the element city.

Finally, note that the defaults mechanism is not yet completely stable, and may still be subject to modification. If changes are made, every effort will be made to support automatic conversion to a new mechanism via the pmlupgrade utility.

### Recommended Frame Numbering System

The PhotoML DTD assumes that film rolls, frames, etc. are assigned unique identifiers. This section describes a recommended numbering system for photographic images, to be used within PhotoML documents. The general format consists of a full or partial date (that is, a year, a year and month, or a year, month, and day), a number within a grouping for that partial date (for example, a number for a roll of film started on the date part of the identifier), and a frame number with respect to the grouping (for example, a frame number within the roll). In the following forms `year` denotes a four digit number, `month` denotes a two digit number (range 01 to 12), `day` denotes a two digit number (range 01 to 31), and `roll number`, `digital media number`, and `frame number` denote two or three digit numbers with leading zeros where necessary.

#### Roll Film

The recommended forms are

    <year>r<roll number>f<frame number>

or

    <year>-<month>r<roll number>f<frame number>

For example, `2001r31f08` denotes frame 8 on roll 31 of the year 2001, while `2001-05r03f12` denotes frame 12 on roll 3 of May 2001.

#### Digital Camera Images

The recommended forms are

    <year>d<digital media number>f<frame number>

or

    <year>-<month>d<digital media number>f<frame number>

or

    <year>-<month>-<day>d<frame number>

For example, `2000d020f12` denotes frame 12 on compact flash card 20 (assuming a policy of assigning a new number each time an empty card is loaded) of the year 2000, while `2000-01d03f09` denotes frame 9 on compact flash card 3 of January 2000, and `2000-02-21d45` denotes frame 45 taken on 21 February 2000.

#### Sheet Film

The recommended forms are

    <year>-<month>s<frame number>

or

    <year>-<month>-<day>s<frame number>

For example, `2002-10s05` denotes frame 5 taken during October 2002, while `2002-03-09s02` denotes frame 2 taken on 9 October 2002.

### Image Identifiers

An image identifier specifies a specific version of an image derived via editing of an original frame. The recommended form of an image identifier is

    <frame identifier>n<version number>

where `version number` is a two digit number representing the specific version. For example, if two differently cropped images are derived from a scan of frame `2001r31f08`, they may be assigned image numbers `2001r31f08n01` and `2001r31f08n02`.

## Acknowledgments

Thanks to Stephen Darlington and Oskar Ojala for valuable comments and suggestions. Oskar Ojala has also made a number of contributions to the distribution, including the `detailed.xsl` XSLT stylesheet.

## A. XML Editing Tools

A number of XML editing tools are available, including open source, shareware, and commercial products for a variety of platforms.

### Emacs/XEmacs

The emacs and xemacs editors are highly recommended, both of which provide XML editing support via the following extension packages:

psgml | A major mode for editing SGML and XML
tdtd | A major mode for editing DTDs
xslide | A major mode for editing XSL stylesheets
css-mode | A major mode for editing CSS stylesheets

The psgml package relies on the nsgml parser for validation. The environment variable `SGML_SEARCH_PATH` needs be set so that the PhotoML DTD can be found; for editing after building the PhotoML distribution, but prior to installation, the following command issued from the distribution root directory will work for csh/tcsh:

    setenv SGML_SEARCH_PATH `(cd dtd; pwd)`

or for sh/bash:

    SGML_SEARCH_PATH=`(cd dtd; pwd)`; export SGML_SEARCH_PATH

After installation, this environment variable should be set to the directory in which the DTD, entities etc. are installed - `/usr/local/share/photoml/dtd` by default.

## B. PhotoML DTD

PhotoML: Photo Description Markup Language
Version: 0.13 Date: 12 November 2010
The recommended formal public identifier for this DTD is:
"-//BW//DTD PhotoML 0.13//EN"
Please consult the comments in this file, and the notes in the
PhotoML distribution documentation.
Copyright © 2002-2010 Brendt Wohlberg <photoml@wohlberg.net>
This is free software; you can redistribute it and/or modify it
under the terms of version 2 of the GNU General Public License
at http://www.gnu.org/licenses/gpl-2.0.txt.
This DTD is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
Acknowledgement: Thanks to Stephen Darlington and Oskar Ojala for
valuable comments and suggestions.

### Parameter Entities

#### xml-lang-attribute

The language specification attribute

Definition | "xml:lang NMTOKEN #IMPLIED"

#### Text

Unrestricted text string

Definition | "#PCDATA"

#### Integer

An integer

Definition | "#PCDATA"

#### PositiveInteger

A positive integer (including zero)

Definition | "#PCDATA"

#### Real

A real number

Definition | "#PCDATA"

#### Rational

A rational number, expressed either as a decimal fraction or in numerator/denominator form

Definition | "#PCDATA"

#### Fraction

A fraction, expressed either as a real number, or as the quotient of two integer or real numbers

Definition | "#PCDATA"

#### HexString

A string of hexadecimal digits

Definition | "#PCDATA"

#### YearMonth

A date string without the day

Definition | "#PCDATA"

#### Date

A date

Definition | "#PCDATA"

#### Time

A time

Definition | "#PCDATA"

#### DateTime

A date and time

Definition | "#PCDATA"

#### TimeInterval

A time interval

Definition | "#PCDATA"

#### EmailAddress

An email address

Definition | "#PCDATA"

#### PhoneNumber

A phone number

Definition | "#PCDATA"

#### CompassDirection

A compass direction

Definition | "#PCDATA"

#### ElevationAngle

An elevation angle

Definition | "#PCDATA"

#### Latitude

A latitude value

Definition | "#PCDATA"

#### Longitude

A longitude value

Definition | "#PCDATA"

### Elements

#### photo

The root element contains optional default settings, photograph description elements roll (for roll film), sheet (for sheet film), and digital (for photographs taken using a digital camera), and digimage elements describing specific digital images, either direct from a camera or scanner, or derived via editing, composition etc.

Content model | (defaults?, (roll | sheet | digital | digimage | digimage-set)+)+
Attributes | xml:lang | NMTOKEN | #IMPLIED
Used inside |

#### defaults

Elements contained within a defaults element provide default values for the corresponding elements in which the relevant information has not been specified. A full description of the semantics of this element is rather lengthy, and may be found in the accompanying documentation.

Content model | (film?, processing?, frame?, properties?, history?)
Attributes | combine | (merge|replace) | 'merge'
Used inside | photo | roll | digital | frame-set | digimage-set

#### roll

The details of a roll of film (e.g. 35mm, APS, 120). Optional film and processing descriptions are followed by a sequence of optional loading details, optional defaults (to be applied to the following frames), frame descriptions, and optional unloading details. A defaults element must always precede at least one frame element, and load and unload elements, if present, must respectively precede and follow some group of frame elements. The id attribute specifies an identity/name assigned to the roll.

Content model | (collection*, description?, film?, processing?, (load?, (defaults?, (frame | frame-set))+, unload?)+, note?)
Attributes | id | NMTOKEN | #REQUIRED
Used inside | photo

#### sheet

The details of a single sheet of film (e.g. 4x5, 8x10). Optional film, processing and loading descriptions precede the single frame description, which is followed by an optional unloading description. The id attribute specifies an identity/name assigned to the sheet.

Content model | (collection*, film?, processing?, load?, frame, unload?, note?)
Attributes | id | NMTOKEN | #REQUIRED
Used inside | photo

#### digital

The details of a sequence of digital photographs. Each group of frame descriptions may be preceded by a defaults element. The id attribute specifies an identity/name assigned to the digital sequence.

Content model | (collection*, description?, (defaults?, (frame | frame-set))+, note?)
Attributes | id | NMTOKEN | #REQUIRED
Used inside | photo

#### collection

A collection of photograph descriptions that should be grouped together. Particularly useful for sheet film, since each sheet element describes a single photo, but also useful, for example, for a number of roll film descriptions for the same day, event, trip etc. The id attribute allows an identity/name to be assigned to the collection, the cgid attribute provides a collection based id for the group (roll, digital, or sheet), and the optional fstfid and lstfid specify initial and final frame ids for a subset of the frames in the group.

Content model | (description?, note?)
Attributes | id | NMTOKEN | #REQUIRED
| cgid | NMTOKEN | #REQUIRED
| fstfid | NMTOKEN | #IMPLIED
| lstfid | NMTOKEN | #IMPLIED
Used inside | roll | sheet | digital

#### description

A brief description of the parent element. Provides a description of the scene or location for a specific frame when a child of the scene or location elements, or of an entire collection, roll, or digital photography session, providing information relevant to all of the frames within the grouping, when a child of the collection, roll, or digital elements.

Content model | %Text;
Attributes | xml:lang | NMTOKEN | #IMPLIED
Used inside | roll | digital | collection | scene | location | estimation | operation

#### note

A note for miscellaneous details of the parent element.

Content model | %Text;
Attributes | xml:lang | NMTOKEN | #IMPLIED

Used inside

roll | sheet | digital | collection | film | processing | lab | developing | developer | load | unload | frame | photographer | ipr | scene | occasion | location | coordinates | measurement | object | equipment | body | body-attachment | lens | lens-attachment | illumination | support | device | exposure | focus | digimage | properties | history | editing | scanner | camera | software | hardware | settings | operation

#### film

A description of the film used.

Content model | (make?, name?, speed?, process?, type?, format?, expiry?, note?)
Used inside | defaults | roll | sheet

#### make

The manufacturer of the product, e.g. Fuji (when the parent element is film).

Content model | %Text;
Used inside | film | developer | body | lens | device | hardware

#### name

The name of a person, business, or product, e.g. Velvia (when the parent element is film).

Content model | %Text;
Used inside | film | lab | developer | photographer | owner | person | object | software

#### speed

The ISO film speed, e.g. 50.

Content model | %PositiveInteger;
Used inside | film

#### process

The appropriate film developing process. Recommended values are C41 (standard negative film), E6 (standard slide film), K14 (Kodachrome) and B&W (black and white). A custom designation should be used for processes not listed here. As a child of the film element, this indicates the designated process of the film. In the case of cross-processing, a different process may be specified as a child of the developing element.

Content model | %Text;
Used inside | film | developing

#### type

The type of a film (recommended values for film type are colour positive, colour negative, b&w positive, and b&w negative), camera body (e.g. SLR, TLR, rangefinder), or lens (e.g. zoom, prime).

Content model | %Text;
Used inside | film | body | lens

#### format

The film format. Recommended values are APS, 35mm (or 135), 120 or 220 for medium format, and the film size for large format.

Content model | %Text;
Used inside | film

#### expiry

The film expiry (expiration in the US) date. The format is YYYY-MM since film expiry dates usually only specify a year and month.

Content model | %YearMonth;
Used inside | film

#### processing

A description of the film processing.

Content model | (lab?, tag?, date?, time?, developing?, note?)
Used inside | defaults | roll | sheet

#### tag

The number of the double/triple check tag affixed to the film by the lab.

Content model | %Text;
Used inside | processing

#### date

A date, represented in the format YYYY[-MM[-DD]].

Content model | %Date;
Used inside | processing | load | unload | occasion | measurement | origin | editing

#### time

A time, represented in the format hh[:mm[:ss[.ss*]]]. The optional zone attribute represents the time zone in the format (+|-)hh[:mm].

Content model | %Time;
Attributes | zone | CDATA | #IMPLIED
Used inside | processing | load | unload | occasion | measurement | origin | editing

#### lab

The lab that developed the film. The optional href attribute represents the laboratory web page.

Content model | (name, address?, phone?, fax?, email?, note?)
Attributes | href | CDATA | #IMPLIED
Used inside | processing

#### address

The address of a person or business.

Content model | %Text;
Used inside | lab | photographer | owner | person | object

#### phone

The phone number of a person or business.

Content model | %PhoneNumber;
Used inside | lab | photographer | owner | person

#### fax

The fax number of a person or business.

Content model | %PhoneNumber;
Used inside | lab | photographer | owner | person

#### email

The email address of a person or business.

Content model | %EmailAddress;
Used inside | lab | photographer | owner | person

#### developing

A description of the development stage of processing.

Content model | (process?, shift?, developer?, method?, agitation?, temperature?, duration?, note?)
Used inside | processing

#### shift

The number of stops push or pull applied during processing.

Content model | %Real;
Attributes | type | (push|pull) | #REQUIRED
Used inside | developing

#### method

The development method, e.g. daylight tank, tray etc.

Content model | %Text;
Used inside | developing

#### agitation

Description of the agitation during development.

Content model | %Text;
Used inside | developing

#### temperature

The temperature of the developer solution (in degrees Celcius by default).

Content model | %Real;
Attributes | units | CDATA | '°C'
Used inside | developing

#### duration

The amount of time the film spent in the developer, represented in the form %m:%s (minutes:seconds).

Content model | %TimeInterval;
Used inside | developing

#### developer

The developer solution used.

Content model | (make?, name?, dilution?, note?)
Used inside | developing

#### dilution

The dilution of the developer solution.

Content model | %Text;
Used inside | developer

#### load

Film loading details.

Content model | (date?, time?, note?)
Used inside | roll | sheet

#### unload

Film unloading details.

Content model | (date?, time?, note?)
Used inside | roll | sheet

#### frame-set

A container allowing the scope of defaults elements to be restricted to the contained set of frame elements.

Content model | (defaults?, ((frame | frame-set)+, defaults?)+)
Used inside | roll | digital | frame-set

#### frame

The frame element describes a single frame in a roll of film or sequence of digital photos, and also describes the single frame on a piece of sheet film. The id attribute should be an identifying number assigned in chronological sequence (e.g. 01, 02 etc.). If the actual frame number marked on the film differs from the id, it may be recorded using the fn attribute. The fn attribute is also useful in other situations, e.g. when the camera exposes film beginning at the end, so the the id numbers increase in chronological order while the fn values decrease. A frame that is not a child of a digital element should not have a digimage child element.

Content model | (photographer?, ipr?, scene?, equipment?, exposure?, focus?, size?, evaluation?, condition?, digimage?, index-image?, note?)
Attributes | id | NMTOKEN | #IMPLIED
| fn | CDATA | #IMPLIED
Used inside | defaults | roll | sheet | digital | frame-set

#### size

The physical size of the frame. The value may be specified as actual physical dimensions in the format <width>x<height> (e.g. a value of "24x36" with units "mm" for standard 135 (35mm) film frames, or a value of "56x41.5" with units "mm" for 645 frames on 120 film), in which case the units attribute must be specified, or as standard frame size designations (e.g. "645", "6x6", "6x7", etc. on 120 film, or "4x5", "8x10" etc. large format film), in which case the units attribute must be omitted as an indication that the value does not represent an actual physical measurement.

Content model | %Text;
Attributes | units | CDATA | #IMPLIED
Used inside | frame

#### condition

A description of any damage, such as scratches, to a frame.

Content model | %Text;
Attributes | xml:lang | NMTOKEN | #IMPLIED
Used inside | frame

#### index-image

The index-image allows the specification of the location of an index image suitable for viewing in an image index, and should therefore be small enough for convenient display in a web browser (for example), but larger than a thumbnail. This facility is useful for constructing indices of frame descriptions, or, within digimage elements, when the actual digital image being described is too large for convenient display in this context.

Content model | EMPTY
Attributes | href | CDATA | #IMPLIED
Used inside | frame | digimage

#### photographer

The name and other details of the photographer. The optional href attribute represents the photographer's web page.

Content model | (name, address?, phone?, fax?, email?, note?)
Attributes | href | CDATA | #IMPLIED
Used inside | frame

#### ipr

Intellectual Property Rights details

Content model | (copyright?, owner?, note?)
Used inside | frame

#### copyright

A copyright statement

Content model | %Text;
Attributes | xml:lang | NMTOKEN | #IMPLIED
Used inside | ipr

#### owner

Details of the copyright owner. The optional href attribute represents the owner's web page.

Content model | (name, address?, phone?, fax?, email?)
Attributes | href | CDATA | #IMPLIED
Used inside | ipr

#### scene

A description of the scene depicted in the frame

Content model | (occasion?, location?, description?, caption?, genre?, keywords?, content?, note?)
Used inside | frame

#### caption

A short descriptive caption for the photograph.

Content model | %Text;
Attributes | xml:lang | NMTOKEN | #IMPLIED
Used inside | scene

#### genre

The genre of the scene, e.g. portrait, landscape, sport, travel, macro etc.

Content model | %Text;
Used inside | scene

#### keywords

Keywords relevant to the description of the scene.

Content model | %Text;
Attributes | xml:lang | NMTOKEN | #IMPLIED
Used inside | scene

#### occasion

A description of when the photograph was taken.

Content model | (date?, time?, event?, note?)
Used inside | scene

#### event

A description of the event at which the photo was taken.

Content model | %Text;
Attributes | xml:lang | NMTOKEN | #IMPLIED
Used inside | occasion

#### location

A description of the location at which the photo was taken. The content model is intended to allow a wide range of locations to be described, but this flexibility also allows incoherent choices, which should be avoided. These descriptions will usually follow one of the patterns: country,region,...,city,... (indicating a location within the borders of some country), ocean,sea,island,... (indicating a location on an island that may be a possession of, but is not considered to be within the borders of, any country), ocean,sea,description (indicating a location removed from any land mass, e.g. on a ship at sea), continent,region,... (indicating a location on a continent that is not within the borders of any country - the continent in question will invariably be Antarctica). With the exception of the description element, child elements with text content should contain only the name of the associated location component, and not a descriptive sentence.

Content model | (((ocean?, sea?, island?) | (continent?, country?)), region?, subregion?, district?, city?, subcity?, subsubcity?, area?, subarea?, road?, place?, point?, description?, coordinates?, direction?, note?)
Used inside | scene

#### ocean

If the location is at sea, at a distance from a continent or island, the ocean may be specified.

Content model | %Text;
Attributes | xml:lang | NMTOKEN | #IMPLIED
Used inside | location

#### sea

The sea, if any, within the relevant ocean (e.g. the Andaman Sea is part of the Indian Ocean).

Content model | %Text;
Attributes | xml:lang | NMTOKEN | #IMPLIED
Used inside | location

#### island

An island within the specified ocean or sea. This element is intended for islands which may be posessions of, but are not considered an integral part of any country.

Content model | %Text;
Attributes | xml:lang | NMTOKEN | #IMPLIED
Used inside | location

#### continent

The continent of the location. This would usually be omitted, but would be used if the location is not part of any country (e.g. a part of Antarctica).

Content model | %Text;
Attributes | xml:lang | NMTOKEN | #IMPLIED
Used inside | location

#### country

The country of the location.

Content model | %Text;
Attributes | xml:lang | NMTOKEN | #IMPLIED
Used inside | location

#### region

A region within the location. The type attribute may be used to specify the type of region (e.g. province, state, etc.). For example, in the US, typical usage would be to use the region element to represent a state, and the subregion or district element to represent a county, while in Italy a region element would represent an official region, and a subregion element would represent a province.

Content model | %Text;
Attributes | type | CDATA | #IMPLIED
| xml:lang | NMTOKEN | #IMPLIED
Used inside | location

#### subregion

A subdivision of the region. The type attribute may be used to specify the type of subdivision.

Content model | %Text;
Attributes | type | CDATA | #IMPLIED
| xml:lang | NMTOKEN | #IMPLIED
Used inside | location

#### district

A subdivision of the subregion, when necessary. May also be a direct subdivision of the region when the subregion is omitted. The type attribute may be used to specify the type of subdivision.

Content model | %Text;
Attributes | type | CDATA | #IMPLIED
| xml:lang | NMTOKEN | #IMPLIED
Used inside | location

#### city

The city of the location.

Content model | %Text;
Attributes | xml:lang | NMTOKEN | #IMPLIED
Used inside | location

#### subcity

A subdivision of the city, such as a suburb, borough, or ward. The type attribute may be used to specify the type of subdivision (e.g. an arrondissement of Paris or a ku (ward) of Tokyo).

Content model | %Text;
Attributes | type | CDATA | #IMPLIED
| xml:lang | NMTOKEN | #IMPLIED
Used inside | location

#### subsubcity

A subdivision of the subcity, when necessary (for example, Asakusa is a subdivision of Taito-ku, which is a ward of Tokyo). The type attribute may be used to specify the type of subdivision.

Content model | %Text;
Attributes | type | CDATA | #IMPLIED
| xml:lang | NMTOKEN | #IMPLIED
Used inside | location

#### area

The area is intended for a level of detail below that of city, when a city is specified (e.g. `Central Park'), or below that of district when there is no relevant city (e.g. `Kruger National Park'). The type attribute may be used to specify the type of subdivision.

Content model | %Text;
Attributes | type | CDATA | #IMPLIED
| xml:lang | NMTOKEN | #IMPLIED
Used inside | location

#### subarea

The subarea is intended for a level of detail below that of area (e.g. 'Conservatory Garden' when the area is 'Central Park', or 'Skukuza Camp' when the area is `Kruger National Park').

Content model | %Text;
Attributes | type | CDATA | #IMPLIED
| xml:lang | NMTOKEN | #IMPLIED
Used inside | location

#### road

A road or city street.

Content model | %Text;
Attributes | xml:lang | NMTOKEN | #IMPLIED
Used inside | location

#### place

The place is intended for a level of detail below that of area, when appropriate. The type attribute may be used to specify the type of subdivision.

Content model | %Text;
Attributes | xml:lang | NMTOKEN | #IMPLIED
Used inside | location

#### point

The point is intended for a level of detail below that of place, when necessary.

Content model | %Text;
Attributes | xml:lang | NMTOKEN | #IMPLIED
Used inside | location

#### coordinates

The (latitude, longitude, altitude) coordinates (e.g. obtained from a GPS device) of the location. The datum attribute specifies the map datum for the coordinate system, which is WGS 84 by default. The relevance attribute specifies whether the coordinates represent an estimate of the specific point at which the photo was taken, or merely indicate the general area (e.g. if the photo was taken at a significant monument, the coordinates might be copies from the wikipedia entry for that monument). The uncertainty attribute provides an estimate of the uncertainty (in units of metres) of the coordinates. When the relevance is set to "area" and an uncertainty estimate is provided, the implication is that the unknown "point" coordinates lie within the uncertainty radius of the provided coordinates.

Content model | (latitude?, longitude?, altitude?, measurement?, estimation?, note?)
Attributes | datum | CDATA | 'WGS 84'
| relevance | (point|area) | #IMPLIED
| uncertainty | CDATA | #IMPLIED
Used inside | location

#### latitude

The location latitude.

Content model | %Latitude;
Used inside | coordinates | measurement

#### longitude

The location longitude.

Content model | %Longitude;
Used inside | coordinates | measurement

#### altitude

The location altitude (in metres by default). The optional reference attribute specifies whether the specified altitude is Above Mean Sea Level or Above Ground Level.

Content model | %Real;
Attributes | units | CDATA | 'm'
| reference | (amsl|agl) | #IMPLIED
Used inside | coordinates | measurement

#### measurement

Details of the measurement of the location coordinates. Note that measurement implies the use of a GPS receiver or other navigation device, while estimation refers to a (usually) less reliable approach, by use of a map or satellite imagery with coordinates, or by comparison with a separate geotagged image of approximately the same scene. The optional association attribute indicates whether the location information was associated with the photo at the time of creation ("immediate"), by use of a GPS device tethered to a DSLR, for example, or at a later stage ("delayed"), by correlating a GPS log with an EXIF time stamp, for example.

Content model | (device?, date?, time?, latitude?, longitude?, altitude?, hdop?, vdop?, pdop?, note?)
Attributes | association | (immediate|delayed) | #IMPLIED
Used inside | coordinates

#### hdop

Horizontal Dilution of Precision (of a GPS measurement).

Content model | %Real;
Used inside | measurement

#### vdop

Vertical Dilution of Precision (of a GPS measurement).

Content model | %Real;
Used inside | measurement

#### pdop

Positional Dilution of Precision (of a GPS measurement).

Content model | %Real;
Used inside | measurement

#### estimation

Details of the estimation of the coordinates, e.g. by locating relevant features on a map. Typically only one of the measurement or estimation elements will be specified, but if both are present, the implication is that the measured coordinates were modified based on some other method of estimating the position. For example, if GPS data are available, but are inaccurate due to poor reception, the coordinates may be estimated by using a recognised location on a map, but it may still be desired to record the measured location in case the estimate is later found to be poor.

Content model | ((source-frame | source-ref)?, description?)
Used inside | coordinates

#### source-frame

If the coordinates are estimated by comparing the scene with another photo with known coordinates, and which has been assigned a group-id and frame-id, the source-frame element may be used to provide relevant information on the geotagged photo, and the group-id and frame-id attributes should provide its corresponding id tags.

Content model | %Text;
Attributes | group-id | NMTOKEN | #IMPLIED
| frame-id | NMTOKEN | #IMPLIED
Used inside | estimation

#### source-ref

If the approximate coordinates are obtained from some internet resource, the source-ref element may be used to describe the resource, and the href attribute should provide a link to the relevant resource (e.g. a wikipedia entry).

Content model | %Text;
Attributes | href | CDATA | #IMPLIED
Used inside | estimation

#### direction

The direction in which the camera was pointed (i.e. from the viewpoint to the scene; coordinates are usually considered to be of the scene viewpoint, and always have this interpretation when direction is specified).

Content model | (azimuth?, elevation?)
Used inside | location

#### azimuth

The compass direction of the scene from the viewpoint (e.g. "0" for North, "90" for East, etc.) in the range 0 to 360 (degrees).

Content model | %CompassDirection;
Used inside | direction

#### elevation

The elevation angle of the scene from the viewpoint (e.g. "0" for horizontal, "90" for directly upwards, etc.) in the range -90 to 90 (degrees).

Content model | %ElevationAngle;
Used inside | direction

#### content

A detailed description of the scene content.

Content model | ((person | object)+ | segment+)
Used inside | scene

#### person

The optional href attribute represents the person's web page.

Content model | (name, address?, phone?, fax?, email?)
Attributes | href | CDATA | #IMPLIED
Used inside | content | segment

#### object

The optional type and href attributes represent the object type (e.g. building, vehicle) and a URL associated with the object (e.g. for a museum).

Content model | (name?, address?, note?)
Attributes | type | CDATA | #IMPLIED
| href | CDATA | #IMPLIED
Used inside | content | segment

#### segment

A segment of the scene. The label attribute allows identification of segments (e.g. foreground, upper-left, etc.

Content model | (segment | person | object)+
Attributes | label | CDATA | #IMPLIED
Used inside | content | segment

#### equipment

A description of the camera and associated equipment.

Content model | (body?, body-attachment?, lens?, lens-attachment?, illumination?, support?, note?)
Used inside | frame

#### body

The camera body. While often fixed for a particular roll, it is included here since it forms part of the equipment, and is also not always fixed (e.g. APS mid-roll roll change).

Content model | (make?, model?, serial?, type?, note?)
Used inside | equipment

#### body-attachment

An accessory attached to the body, e.g. motor-drive, multi-function back

Content model | (device+, note?)
Used inside | equipment

#### lens

A lens.

Content model | (make?, model?, serial?, type?, note?)
Used inside | equipment

#### lens-attachment

An accessory attached to the lens, e.g. teleconverter, extension-tube, diopter, filter, lens-hood.

Content model | (device+, note?)
Used inside | equipment

#### illumination

An illumination source, e.g. flash.

Content model | (device+, note?)
Used inside | equipment

#### support

A support, e.g. tripod leg set, ball-head, monopod.

Content model | (device*, note?)
Used inside | equipment

#### device

A description of an item of equipment. The optional type attribute represents the device type (e.g. filter, ball-head, flash).

Content model | (make?, model?, serial?, firmware?, note?)
Attributes | type | CDATA | #IMPLIED
Used inside | measurement | body-attachment | lens-attachment | illumination | support

#### model

The model number/code of a photographic product.

Content model | %Text;
Used inside | body | lens | device | hardware

#### serial

The serial number/code of a photographic product.

Content model | %Text;
Used inside | body | lens | device | hardware

#### firmware

The firmware version.

Content model | %Text;
Used inside | device | hardware

#### exposure

A description of film exposure and camera metering settings.

Content model | (aperture?, shutter?, exp-comp?, flash?, flash-comp?, rated-speed?, mode?, metering?, note?)
Used inside | frame

#### aperture

The lens aperture in f/-stops.

Content model | %Real;
Used inside | exposure

#### shutter

The shutter speed in seconds.

Content model | %Fraction;
Used inside | exposure

#### exp-comp

Exposure compensation in EV units.

Content model | %Real;
Used inside | exposure

#### flash

Flash usage description.

Content model | %Text;
Used inside | exposure

#### flash-comp

Flash exposure compensation in EV units.

Content model | %Real;
Used inside | exposure

#### rated-speed

ISO speed setting of the camera (useful if different from the actual film ISO speed, or for a digital camera).

Content model | %PositiveInteger;
Used inside | exposure

#### mode

Exposure mode (e.g. program, manual, shutter priority) for an automated camera.

Content model | %Text;
Used inside | exposure | focus

#### metering

Metering mode (e.g. matrix, centre-weighted, spot).

Content model | %Text;
Used inside | exposure

#### focus

Information relevant to lens focus.

Content model | (focal-length?, focal-distance?, mode?, note?)
Used inside | frame

#### focal-length

The lens focal length (useful when the lens doesn't have a fixed focal length), in millimeters by default.

Content model | %Real;
Attributes | units | CDATA | 'mm'
Used inside | focus

#### focal-distance

The focal distance (in metres by default).

Content model | %Real;
Attributes | units | CDATA | 'm'
Used inside | focus

#### evaluation

An evaluation of the merits of the frame. If a score attribute is specified, it represents the aggregate rating for the frame, independent of the score values for child elements; if it is not specified, the aggregate score should be computed as a weighted average of the score attributes of child elements.

Content model | (artistic?, technical?)
Attributes | score | CDATA | #IMPLIED
Used inside | frame

#### artistic

An evaluation of the artistic merits of the frame. The element content is a comment on the evaluation, and a numeric rating is provided by the score attribute.

Content model | %Text;
Attributes | score | CDATA | #IMPLIED
Used inside | evaluation

#### technical

An evaluation of the technical merits (focus, depth of field, etc.) of the frame. The element content is a comment on the evaluation, and a numeric rating is provided by the score attribute.

Content model | %Text;
Attributes | score | CDATA | #IMPLIED
Used inside | evaluation

#### digimage

The details of an individual digital image. The optional href attribute represents the location of the digital image file being described. The group-id attribute is the id of the roll, sheet, or digital element in which the corresponding photographic frame is described, the frame-id attribute is the id of that frame element, and the image-id provides an id number for the specific digital file representing that frame (e.g. two scans of the same film frame would have the same group-id and frame-id, but different image-id.

Content model | (properties?, history?, index-image?, note?)
Attributes | href | CDATA | #IMPLIED
| group-id | NMTOKEN | #IMPLIED
| frame-id | NMTOKEN | #IMPLIED
| image-id | NMTOKEN | #IMPLIED
Used inside | photo | frame | digimage-set

#### digimage-set

A container allowing the scope of defaults elements to be restricted to the contained set of digimage elements.

Content model | (defaults?, ((digimage | digimage-set)+, defaults?)+)
Used inside | photo | digimage-set

#### properties

Details of the image properties.

Content model | ((width, height)?, bit-depth?, file-format?, icc-profile?, file-hash?, image-hash?, note?)
Used inside | defaults | digimage

#### width

The image width in pixels

Content model | %PositiveInteger;
Used inside | properties

#### height

The image height in pixels

Content model | %PositiveInteger;
Used inside | properties

#### bit-depth

The bit depth of a sample, commonly 8 or 12 bits per colour band per pixel.

Content model | %PositiveInteger;
Used inside | properties

#### file-format

The image format. This may either be described by using the std attribute within an empty element, or omitting the std attribute and describing the format within the element content. When possible, the former approach is preferred.

Content model | %Text;
Attributes | std | (bmp|crw|cr2|dng|jpeg|j2k|nef|pef|png|psd|tiff) | #IMPLIED
Used inside | properties

#### icc-profile

The ICC profile for the image colour space. The optional href refers to the relevant ICC profile specification file.

Content model | %Text;
Attributes | href | CDATA | #IMPLIED
Used inside | properties

#### file-hash

The result of a hash function applied to the image file. Not as reliable as the hash value of the image content (i.e. the raw decoded bitmap representation of the image, which is not dependent on the specific image file format), but may be faster to compute in some circumstances, and therefore useful for an initial match test.

Content model | %HexString;
Attributes | type | (md5|sha-256) | 'md5'
Used inside | properties | source-image

#### image-hash

The result of a hash function applied to the image content. Useful for ensuring a correct match between the image description and the image data file.

Content model | %HexString;
Attributes | type | (md5|sha-256) | 'md5'
Used inside | properties | source-image

#### history

Details of the creation and editing history of the image. More than one editing element is allowed so that multiple stages of editing, using different software, may be described.

Content model | (origin?, editing*, note?)
Used inside | defaults | digimage

#### origin

Details of the origin of the image; either a film scanner or digital camera, or source image(s) from which it is derived via editing (multiple source images are possible when, for example, a panoramic image is composed of a number of smaller images).

Content model | ((date?, time?, (scanner | camera)?) | source-image+)
Used inside | history

#### editing

Details of the editing operations applied to the image.

Content model | (date?, time?, software?, operations?, note?)
Used inside | history

#### scanner

The details of the scanner and scanning process.

Content model | (hardware?, software?, settings?, note?)
Used inside | origin

#### camera

The details of the digital camera.

Content model | (hardware?, settings?, note?)
Used inside | origin

#### source-image

A description of the source image to which editing operations were applied to derive the image described by the image element. The group-id and frame-id attributes should only be used when they differ from the respective values of the image element.

Content model | (file-hash?, image-hash?)
Attributes | href | CDATA | #IMPLIED
| group-id | NMTOKEN | #IMPLIED
| frame-id | NMTOKEN | #IMPLIED
| image-id | NMTOKEN | #IMPLIED
Used inside | origin

#### software

The software used to perform the editing.

Content model | (publisher?, name?, version?, note?)
Used inside | editing | scanner

#### operations

The details of the editing operations.

Content model | operation+
Used inside | editing

#### hardware

The details of the camera or scanner hardware.

Content model | (make?, model?, serial?, firmware?, note?)
Used inside | scanner | camera

#### settings

The details of the camera, scanner, or editing software settings.

Content model | (setting+, note?)
Used inside | scanner | camera | operation

#### publisher

The name of the company that developed the software.

Content model | %Text;
Used inside | software

#### version

The version number of the software.

Content model | %Text;
Used inside | software

#### operation

The details of an individual edit. In addition to the text description, further details may be specified by providing the relevant command line when editing was performed via a command shell, or settings for operations applied via a GUI.

Content model | (description?, (command | settings)?, note?)
Used inside | operations

#### command

The command line used to apply the edit.

Content model | %Text;
Used inside | operation

#### setting

The setting element describes software configuration settings during scanning. The name attribute should contain the name of the setting (e.g. multi-pass, ICE), and the element content represents the corresponding value.

Content model | %Text;
Attributes | name | CDATA | #REQUIRED
| units | CDATA | #IMPLIED
Used inside | settings