Empty nodes aren't any more useful than absent nodes in the technical
sense... It just means that while the instance validates against the schema,
your code has to be littered with lots of things like:
if (theElement.toString().trim().length() > 0){...
...And also to ensure that no views depend on values being non-empty
strings, for example to be used as hyperlink anchors. Which is all a bit
boring but sadly necessary...
IMHO, if a field is mandatory, a blank value isn't valid. If you are going
to create an empty node, better just to omit the node - if that throws a
processing error, well so SHOULD an empty node, if the coder of the target
system has properly handled such things.
If you need to support fragmentary records (that is, with missing mandatory
data) internally within a workflow, that isn't an interoperability issue -
but you don't want to be sending such records to external targets without
prior agreement, or you should expect to have those records rejected as
being incomplete.
- S
On 13/7/04 11:18 am, "Andrew Middleton" <[log in to unmask]> wrote:
> I think your point about mandatory elements is really useful. We are all
> aware of what seems to be an eternal discussion about the practical
> difficulties of assigning good quality metadata, or having it assigned. In
> my view the quality starts to suffer when people equipped or tasked into
> filling complete metadata records come across fields that they are not best
> suited to complete. A metadata record is best completed by several people.
> But that means records are left hanging (indefinitely?), and so not
> compliant, until all quality inputters have done their bit.
>
> In reality it doesn't seem to happen like this at the moment (am I wrong?).
> At the moment the onus tends to be on one person to do the metadata. As a
> consequence, depending on who does it, some elements are of a high quality
> while others are not and so the metadata record, and purpose, suffers.
>
> Why is it OK to have madatory elements that are empty? I always thought
> this was a technical interoperability issue, that some systems could not
> deal with missing elements - they expect the element to appear in the
> structure, yet the value (including none) is irrelevant. I don't know...
>
> So my view is that mandatory is OK if it enhances the interoperability - as
> long as it's OK for elements to be left empty.
|