Attributes of xml elements – Apple Final Cut Pro 7 User Manual

Page 1631

Advertising
background image

Most markup languages have a limited set of tags and rules about how the elements can
be ordered hierarchically. For example, an HTML document can have a <p> element (this
is a paragraph element) but if you added a <sentence> element, it would not be
recognized by HTML-aware applications unless the entire HTML standard were altered.

XML was designed to be extensible—you can define any tags and hierarchical rules that
fit the data you are working with. For example, an XML file that contains store inventory
data might have elements such as <product>, <manufacturer>, <cost>, and <size>. An
XML file that contains video editing information would have very different elements, such
as <clip>, <name>, <duration>, <logginginfo>, and so on.

XML is a strict markup language, which means all tags must be closed. For example, if
your XML document contains a <clip> tag, there must be a corresponding </clip> tag
to close the element. Unclosed tags create errors.

Attributes of XML Elements

Some elements contain identifying information called attributes. In XML, an element’s
attribute looks like this:

<font color=”red”>

...

</font>

In the example above, the font element has an attribute called color, which is set to “red.”
Alternatively, you could choose to structure your XML format without attributes:

<font>

<color>red</color>

...

</font>

Just as XML tags are extensible, so are attributes. When you define the rules of your XML
file, you can allow elements to have any attributes you want. For example, in the
Final Cut Pro XML Interchange Format, every clip can have an “id” attribute so each clip
can be uniquely identified and referenced:

<clip id=”coffee house 1”>

...

</clip>

<clip id =”coffee house 2”>

...

1631

Chapter 97

Using Final Cut Pro XML and QuickTime Metadata

Advertising