XMP Specification Part 3: Storage in Files - Adobe
XMP Specification Part 3: Storage in Files - Adobe
XMP Specification Part 3: Storage in Files - Adobe
Create successful ePaper yourself
Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.
In this example, ‘■’ represents the Unicode “zero width non-break<strong>in</strong>g space character” (U+FEFF) used as a<br />
byte-order marker.<br />
An <strong>XMP</strong> packet must conform to the well-formedness requirements of the XML specification, except for the lack<br />
of an XML declaration at its start. Different packets <strong>in</strong> a file can be <strong>in</strong> different character encod<strong>in</strong>gs, and packets<br />
must not nest.<br />
The follow<strong>in</strong>g sections describe the parts of this example packet.<br />
1.1.1 Header<br />
The header is an XML process<strong>in</strong>g <strong>in</strong>struction of the form:<br />
<br />
The process<strong>in</strong>g <strong>in</strong>struction conta<strong>in</strong>s <strong>in</strong>formation about the packet <strong>in</strong> the form of XML attributes. There are two<br />
required attributes: beg<strong>in</strong> and id, <strong>in</strong> that order. Other attributes can follow <strong>in</strong> any order; unrecognized attributes<br />
should be ignored. Attributes must be separated by exactly one ASCII space (U+0020) character.<br />
NOTE The astute reader might note that XML process<strong>in</strong>g <strong>in</strong>structions do not actually conta<strong>in</strong> “attributes”; formally, they<br />
have an undifferentiated text body. The term attribute is used here colloquially to denote the general syntax of the<br />
xpacket process<strong>in</strong>g <strong>in</strong>struction’s body.<br />
1.1.1.1 Attribute: beg<strong>in</strong><br />
This required attribute <strong>in</strong>dicates the beg<strong>in</strong>n<strong>in</strong>g of a new packet. Its value is the Unicode zero-width nonbreak<strong>in</strong>g<br />
space character U+FEFF, <strong>in</strong> the appropriate encod<strong>in</strong>g (UTF-8, UTF-16, or UTF-32). It serves as a<br />
byte-order marker, where the character is written <strong>in</strong> the natural order of the application (consistent with the byte<br />
order of the XML data encod<strong>in</strong>g).<br />
For backward compatibility with earlier versions of the <strong>XMP</strong> packet specification, the value of this attribute can<br />
be the empty str<strong>in</strong>g, <strong>in</strong>dicat<strong>in</strong>g UTF-8 encod<strong>in</strong>g.<br />
1.2, “Scann<strong>in</strong>g files for <strong>XMP</strong> packets”, describes how an <strong>XMP</strong> packet processor should read a s<strong>in</strong>gle byte at a<br />
time until it has successfully determ<strong>in</strong>ed the byte order and encod<strong>in</strong>g.<br />
1.1.1.2 Attribute: id<br />
The required id attribute must follow beg<strong>in</strong>. For all packets def<strong>in</strong>ed by this version of the syntax, the value of id<br />
is the follow<strong>in</strong>g str<strong>in</strong>g:<br />
W5M0MpCehiHzreSzNTczkc9d<br />
1.1.1.3 Attribute: bytes<br />
This attribute is deprecated.<br />
The optional bytes attribute specifies the total length of the packet <strong>in</strong> bytes, which was <strong>in</strong>tended to allow faster<br />
scann<strong>in</strong>g of <strong>XMP</strong> packets. It was of m<strong>in</strong>imal actual value, and would not work properly <strong>in</strong> text files.<br />
1.1.1.4 Attribute: encod<strong>in</strong>g<br />
This attribute is deprecated.<br />
The optional encod<strong>in</strong>g attribute is identical to the encod<strong>in</strong>g attribute <strong>in</strong> the XML declaration (see productions<br />
[23] and [80] <strong>in</strong> the XML specification). It was <strong>in</strong>tended to specify the character encod<strong>in</strong>g of the packet, but is<br />
redundant with the <strong>in</strong>formation from the beg<strong>in</strong> attribute.<br />
10 ©<strong>Adobe</strong> Systems Incorporated, 2010