Details
Description
AbstractMetadata provides a parse(TreeModel) method which can parse a tree produced by the asTree() method. This is sometime used for updating a metadata edited in a graphical user interface (for example through a Swing JTree). However the current implementation does not handle collections well. If a non-metadata attribute (String, InternationalString, CodeList) is repeated more than once for a given node, only the first occurence is retained instead of building a collection as we would expect.
A proper fix may require that we solve the ambiguity inherent to the current tree representation (when a collection element ends / when the next collection element starts). XML would not have such ambiguity, but in the TreeModel case we are trying to handle the tree in a Swing-friendly way. Some balance needs to be found between that goal and the ISO 19139 verbosity.
