# SimpleTerminologyTest XML file, possible error in the XML file or in the constructor of the class TranslationDetails **Category:** [Reference Implementation: Java (archive)](https://discourse.openehr.org/c/reference-implementation-java-archive/154) **Created:** 2008-10-15 13:45 UTC **Views:** 10 **Replies:** 3 **URL:** https://discourse.openehr.org/t/simpleterminologytest-xml-file-possible-error-in-the-xml-file-or-in-the-constructor-of-the-class-translationdetails/13085 --- ## Post #1 by @Filip_Klasson Hi, I am trying to create an Archetype using the constructor in org.openehr.am.archetype.Archetype.java and i use the SimpleTerminology implementation that uses the XML file openehr_terminology_en.xml as terminology. When i create TranslationDetails which is one of the arguments to the Archetype constructor i get IllegalArgumentException("unknown language "). The code that throws this exception looks like this: if (terminologyService != null && !terminologyService.codeSet("languages").hasLang(language)) { throw new IllegalArgumentException("unknown language " + language); } The reason i get the exception is because the code set identifier "languages" does not exist in the XML file. From what i understand the code set identifiers is the external_id field in the XML file, right? And languages is a openehr_id field. If i change the code to: if (terminologyService != null && !terminologyService.codeSet("ISO_639-1").hasCode(language)) { throw new IllegalArgumentException("unknown language " + language); } then everything works. My question is if the XML file is wrong or if the original code is wrong? It makes more sence to search for the identifier "language" than to search for "ISO_639-1" but that does not work. Cheers, Filip --- ## Post #2 by @system Hi Filip, The validation of translations should be done in the super class of Archetype which is AuthoredResource. The code you showed in your post looks like an old version. The one on the TRUNK is using an java enum instead of strings referring to languages code sets. cheers, Rong --- ## Post #3 by @Filip_Klasson Then i am not sure if i am using the right TRUNK. I downloaded the class org.openehr.rm.common.resource.TranslationDetails.java a few minutes ago from [http://svn.openehr.org/ref_impl_java/TRUNK](http://svn.openehr.org/ref_impl_java/TRUNK) and its identical to the class that produced the exception in my code: if (terminologyService != null && !terminologyService.codeSet("languages").hasLang(language)) { throw new IllegalArgumentException("unknown language " + language); } cheers, Filip 2008/10/15 Rong Chen <[rong.acode@gmail.com](mailto:rong.acode@gmail.com)> --- ## Post #4 by @system Sorry, I looked at the wrong place. Yes, the validation of language code needs a fix. This is hopefully the last place where the codeset name "languages" is hard-coded. Cheers, Rong --- **Canonical:** https://discourse.openehr.org/t/simpleterminologytest-xml-file-possible-error-in-the-xml-file-or-in-the-constructor-of-the-class-translationdetails/13085 **Original content:** https://discourse.openehr.org/t/simpleterminologytest-xml-file-possible-error-in-the-xml-file-or-in-the-constructor-of-the-class-translationdetails/13085