Default attribute values in fcpxml
Default attribute values in fcpxml
- Subject: Default attribute values in fcpxml
- From: Bruce Sharpe <email@hidden>
- Date: Sun, 09 Oct 2011 14:05:06 -0700
I have a suggestion for the next version of fcpxml.
There are several attributes in fcpxml that have default values. These are a nuisance for people who have to parse the XML because it complicates the code and can lead to errors.
There are two types of defaults, "simple" and "complicated". A simple default has a value that does not depend on anything else in the XML document. These can be specified in the DTD, but unfortunately they are currently just documented as comments. Example:
Current (default is documented):
<!ATTLIST clip enabled CDATA #IMPLIED> <!-- default is '1' (0=disabled, 1=enabled) -->
Better (default is specified):
<!ATTLIST clip enabled CDATA "1"> <!-- 0=disabled, 1=enabled -->
A complicated default is one which depends on something else in the document and cannot be specified in the DTD. Example:
<!ATTLIST clip format IDREF #IMPLIED> <!-- default is same as parent -->
For a future version of fcpxml, I propose the following rules for default values:
1. If an attribute is optional, specify it as #IMPLIED
2. If an attribute is required but has a simple default value, specify that value in the DTD
3. If an attribute is required but has a complicated default value, make it #REQUIRED
I suppose #3 could be controversial, but I don't see that having complicated defaults is better for anyone. Any consumer of fcpxml has to figure out the value of the attribute, so having it there explicitly makes life easier. If a program is a producer of fcpxml, it must know the value of the attribute because it is required, and emitting to the XML is trivial.
Bruce
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Pro-apps-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden