Hi Adam,
Can you provide details of the offending archetype?
Looking at the AOM, the originalAuthor is a required attribute and this is
reflected in the Resource.xsd. However apart from the list being non-empty,
I see no other invariant to that states that the value of the originalAuthor
item cannot be an empty string.
Therefore I would suggest that the Java IllegalArgumentException "null or
empty originalAuthor" is too tight. A "not null" invariant seems
reasonable.
However, not being a member of the java implementation I will leave that to
them to decide what to do here.
If there is an issue with the Ocean XML output please feel free to contact
me directly.
The attribute in question, original_author is an attribute of Class RESOURCE_DESCRIPTION from rm.common.resource package. According to the specs (common_im.pdf), the type is Hash<String,String> NOT a string and the invariant on it is “Original_author_valid: original_author /= Void and then not original_author.is_empty”.
The Java implementation (see below) of this invariant is, I believe, faithful interpretation of the specs.
if (originalAuthor == null || originalAuthor.size() == 0 ) {
throw new IllegalArgumentException(“null or empty originalAuthor”);
}
The thing I am not sure here is the XML schema. If the schema is not compliant with the RM specs, perhaps the schema should be updated so the parsing code generated from schema can catch errors like this, thoughts?
It may be possible that the Ocean parser is not currently validating against the schema but I would be interested to see the archetype causing this issue to test this.
The attribute in question, original_author is an attribute of Class
RESOURCE_DESCRIPTION from rm.common.resource package. According to the
specs (common_im.pdf), the type is Hash<String,String> NOT a string
and the invariant on it is "Original_author_valid: original_author /=
Void and then not original_author.is_empty".
The Java implementation (see below) of this invariant is, I believe,
faithful interpretation of the specs.
if (originalAuthor == null || originalAuthor.size() == 0 ) {
throw new IllegalArgumentException("null or empty
originalAuthor");
}
The thing I am not sure here is the XML schema. If the schema is not
compliant with the RM specs, perhaps the schema should be updated so
the parsing code generated from schema can catch errors like this,
thoughts?
Any idea then which is right?
I can chuck you our ADL > XML ant task so you can look at all the
various errors against a given set of our ADL held on the openEHR svn.