For empty values of non-required keys we simply do not export them,
I haven't found any documentation or a list of "non-required keys" or "required keys"-- so with my example "comment 1-4" seems to be required, but "clipcommenta-b" are not. I would say - personal opinion - comment 1-4 seems not to be required as well; FCP will read any XML correctly without any comment entries or the comment nodes at all.
And coming back to the original theme of the thread: timecode is something which is really not required (or supported or needed) when creating FCP XMLs outside from FCP for use with FCP or interchanging FCP XMLs on different systems as FCP always overwrites these values during import/reconnect.
It would be really great if there would be some info on these issues.
so we don't really have the opportunity to export things like:
<mastercomment1/>
Not sure here whether I do understand. If I get an XML node (in any XML) I could say the node has no entry this will mean the node appears as <theNode/> in the XML; this means the same as you wrote below <theNode></theNode> (NO space as there is nothing and no value like space in the node).
FCP does work fine when reading XMLs which do use this "standard <theNode/>"
but in the case of this mastercomments it is not that there is no string value, but actually that the string value is "" (an empty string of length 0). We'd do the same thing if there was a string like " " (space).
As said above maybe you can help me to understand.
Again using the (maybe stupid) comment example I mentioned <clipcommenta> also does have have an empty string of length 0 same as <clipcommenta> and is not saved or written into the XML.
I do not understand the difference between <mastercomment1> (or …2,3,4) and <clipcommenta> (or -b).
It's somehow similar with the <enabled> node -- sometimes it's there, sometimes not. If it is not there it means that the value is "true" -- so this could mean that it is a "required key". Or take the <rate> nodes, there is a <ntsc> node or there is none -- if it is not there it means <ntsc> is "false". Is that a required one or not?
<masterclip> is also some kind of mystery. Many more of those things can be mentioned.
Sorry for bothering you with all this questions.
Would it be still helpful in these cases if it was reduced to something like the following?
<mastercomment1></mastercomment1> (no space)
This would be great!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
and <mastercomment1> </mastercomment1> (space)
I don't see any need for that, as a "space" is a normal entry and that is handled fine with any of the XML versions of FCP.
One thing I've to check again is a "." as a first character of a string (don't remember but I think "-" was a problem as well???) . FCP always tried to interpret string values as a number using the first character and so a "... what do you think?" (not a "… what do you think") comes out as "0". I always insert a non breaking space before these offending chars to prevent that result -- but maybe this is fixed with current versions.
I'll do that first thing tomorrow
Thanks again for all your efforts
Andreas