OJS 3.1.0.1 DOAJ ERROR Unable to validate document with identified schema

Hi,
Today one of our journals has register with DOAJ and when we tried to upload XML file we got error
Unable to validate document with identified schema.

Validation message from schema ‘doaj’: 27:0:ERROR:SCHEMASV:SCHEMAV_CVC_ENUMERATION_VALID: Element ‘keywords’, attribute ‘language’: [facet ‘enumeration’] The value ‘’ is not an element of the set {‘aar’, ‘abk’, ‘ace’, ‘ach’, ‘ada’, ‘afa’, ‘afh’, ‘afr’, ‘aka’, ‘akk’, ‘alb’, ‘ale’, ‘alg’, ‘amh’, ‘ang’, ‘apa’, ‘ara’, ‘arc’, ‘arg’, ‘arm’, ‘arn’, ‘arp’, ‘art’, ‘arw’, ‘asm’, ‘ast’, ‘ath’, ‘aus’, ‘ava’, ‘ave’, ‘awa’, ‘aym’, ‘aze’, ‘bad’, ‘bai’, ‘bak’, ‘bal’, ‘bam’, ‘ban’, ‘baq’, ‘bas’, ‘bat’, ‘bej’, ‘bel’, ‘bem’, ‘ben’, ‘ber’, ‘bho’, ‘bih’, ‘bik’, ‘bin’, ‘bis’, ‘bla’, ‘bnt’, ‘bos’, ‘bra’, ‘bre’, ‘btk’, ‘bua’, ‘bug’, ‘bul’, ‘bur’, ‘cad’, ‘cai’, ‘car’, ‘cat’, ‘cau’, ‘ceb’, ‘cel’, ‘cha’, ‘chb’, ‘che’, ‘chg’, ‘chi’, ‘chk’, ‘chm’, ‘chn’, ‘cho’, ‘chp’, ‘chr’, ‘chu’, ‘chv’, ‘chy’, ‘cmc’, ‘cop’, ‘cor’, ‘cos’, ‘cpe’, ‘cpf’, ‘cpp’, ‘cre’, ‘crp’, ‘cus’, ‘cze’, ‘dak’, ‘dan’, ‘dar’, ‘day’, ‘del’, ‘den’, ‘dgr’, ‘din’, ‘div’, ‘doi’, ‘dra’, ‘dua’, ‘dum’, ‘dut’, ‘dyu’, ‘dzo’, ‘efi’, ‘egy’, ‘eka’, ‘elx’, ‘eng’, ‘enm’, ‘epo’, ‘est’, ‘ewe’, ‘ewo’, ‘fan’, ‘fao’, ‘fat’, ‘fij’, ‘fin’, ‘fiu’, ‘fon’, ‘fre’, ‘frm’, ‘fro’, ‘fry’, ‘ful’, ‘fur’, ‘gaa’, ‘gay’, ‘gba’, ‘gem’, ‘geo’, ‘ger’, ‘gez’, ‘gil’, ‘gla’, ‘gle’, ‘glg’, ‘glv’, ‘gmh’, ‘goh’, ‘gon’, ‘gor’, ‘got’, ‘grb’, ‘grc’, ‘gre’, ‘grn’, ‘guj’, ‘gwi’, ‘hai’, ‘hau’, ‘haw’, ‘heb’, ‘her’, ‘hil’, ‘him’, ‘hin’, ‘hit’, ‘hmn’, ‘hmo’, ‘hun’, ‘hup’, ‘iba’, ‘ibo’, ‘ice’, ‘ido’, ‘iii’, ‘ijo’, ‘iku’, ‘ile’, ‘ilo’, ‘ina’, ‘inc’, ‘ind’, ‘ine’, ‘inh’, ‘ipk’, ‘ira’, ‘iro’, ‘ita’, ‘jav’, ‘jpn’, ‘jpr’, ‘jrb’, ‘kaa’, ‘kab’, ‘kac’, ‘kal’, ‘kam’, ‘kan’, ‘kar’, ‘kas’, ‘kau’, ‘kaw’, ‘kaz’, ‘kbd’, ‘kha’, ‘khi’, ‘khm’, ‘kho’, ‘kik’, ‘kin’, ‘kir’, ‘kmb’, ‘kok’, ‘kom’, ‘kon’, ‘kor’, ‘kos’, ‘kpe’, ‘kro’, ‘kru’, ‘kua’, ‘kum’, ‘kur’, ‘kut’, ‘lad’, ‘lah’, ‘lam’, ‘lao’, ‘lat’, ‘lav’, ‘lez’, ‘lim’, ‘lin’, ‘lit’, ‘lol’, ‘loz’, ‘ltz’, ‘lua’, ‘lub’, ‘lug’, ‘lui’, ‘lun’, ‘luo’, ‘lus’, ‘mac’, ‘mad’, ‘mag’, ‘mah’, ‘mai’, ‘mak’, ‘mal’, ‘man’, ‘mao’, ‘map’, ‘mar’, ‘mas’, ‘may’, ‘mdr’, ‘men’, ‘mga’, ‘mic’, ‘min’, ‘mis’, ‘mkh’, ‘mlg’, ‘mlt’, ‘mnc’, ‘mni’, ‘mno’, ‘moh’, ‘mol’, ‘mon’, ‘mos’, ‘mul’, ‘mun’, ‘mus’, ‘mwr’, ‘myn’, ‘nah’, ‘nai’, ‘nap’, ‘nau’, ‘nav’, ‘nbl’, ‘nde’, ‘ndo’, ‘nds’, ‘nep’, ‘new’, ‘nia’, ‘nic’, ‘niu’, ‘nno’, ‘nob’, ‘non’, ‘nor’, ‘nso’, ‘nub’, ‘nya’, ‘nym’, ‘nyn’, ‘nyo’, ‘nzi’, ‘oci’, ‘oji’, ‘ori’, ‘orm’, ‘osa’, ‘oss’, ‘ota’, ‘oto’, ‘paa’, ‘pag’, ‘pal’, ‘pam’, ‘pan’, ‘pap’, ‘pau’, ‘peo’, ‘per’, ‘phi’, ‘phn’, ‘pli’, ‘pol’, ‘pon’, ‘por’, ‘pra’, ‘pro’, ‘pus’, ‘qaa-qtz’, ‘que’, ‘raj’, ‘rap’, ‘rar’, ‘roa’, ‘roh’, ‘rom’, ‘rum’, ‘run’, ‘rus’, ‘sad’, ‘sag’, ‘sah’, ‘sai’, ‘sal’, ‘sam’, ‘san’, ‘sas’, ‘sat’, ‘scc’, ‘sco’, ‘scr’, ‘sel’, ‘sem’, ‘sga’, ‘sgn’, ‘shn’, ‘sid’, ‘sin’, ‘sio’, ‘sit’, ‘sla’, ‘slo’, ‘slv’, ‘sma’, ‘sme’, ‘smi’, ‘smj’, ‘smn’, ‘smo’, ‘sms’, ‘sna’, ‘snd’, ‘snk’, ‘sog’, ‘som’, ‘son’, ‘sot’, ‘spa’, ‘srd’, ‘srr’, ‘ssa’, ‘ssw’, ‘suk’, ‘sun’, ‘sus’, ‘sux’, ‘swa’, ‘swe’, ‘syr’, ‘tah’, ‘tai’, ‘tam’, ‘tat’, ‘tel’, ‘tem’, ‘ter’, ‘tet’, ‘tgk’, ‘tgl’, ‘tha’, ‘tib’, ‘tig’, ‘tir’, ‘tiv’, ‘tkl’, ‘tli’, ‘tmh’, ‘tog’, ‘ton’, ‘tpi’, ‘tsi’, ‘tsn’, ‘tso’, ‘tuk’, ‘tum’, ‘tup’, ‘tur’, ‘tut’, ‘tvl’, ‘twi’, ‘tyv’, ‘uga’, ‘uig’, ‘ukr’, ‘umb’, ‘und’, ‘urd’, ‘uzb’, ‘vai’, ‘ven’, ‘vie’, ‘vol’, ‘vot’, ‘wak’, ‘wal’, ‘war’, ‘was’, ‘wel’, ‘wen’, ‘wln’, ‘wol’, ‘xho’, ‘yao’, ‘yap’, ‘yid’, ‘yor’, ‘ypk’, ‘zap’, ‘zen’, ‘zha’, ‘znd’, ‘zul’, ‘zun’}.

OJS Validation show errors:

Validation errors:

element decl. 'language', attribute 'type': The QName value '{http://www.doaj.org/schemas/iso_639-2b/1.0}LanguageCodeType' does not resolve to a(n) type definition.

attribute decl. 'language', attribute 'type': The QName value '{http://www.doaj.org/schemas/iso_639-2b/1.0}LanguageCodeType' does not resolve to a(n) simple type definition.

attribute decl. 'language', attribute 'type': The QName value '{http://www.doaj.org/schemas/iso_639-2b/1.0}LanguageCodeType' does not resolve to a(n) simple type definition.

attribute decl. 'language', attribute 'type': The QName value '{http://www.doaj.org/schemas/iso_639-2b/1.0}LanguageCodeType' does not resolve to a(n) simple type definition.
Invalid XML:

<?xml version="1.0" encoding="utf-8"?>
<records xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="http://doaj.org/static/doaj/doajArticles.xsd">
  <record>
    <language>eng</language>
    <publisher>Filozofski fakultet u Novom Sadu</publisher>
    <journalTitle>ISTRAŽIVANJA, Јournal of Historical Researches</journalTitle>
    <issn>0350-2112</issn>
    <eissn>2406-1131</eissn>
    <publicationDate>2018-12-26</publicationDate>
    <issue>29</issue>
    <startPage>201</startPage>
    <endPage>202</endPage>
    <doi>10.19090/i.2018.29.201-202</doi>
    <publisherRecordId>2127</publisherRecordId>
    <title language="eng">Nachruf auf Helmut Rumpler (1935–2018) Kurzbiographie</title>
    <authors>
      <author>
        <name>Ulfried Burtz</name>
        <email>aa@aa.aaa</email>
      </author>
    </authors>
    <abstract language="eng">
    
</abstract>
    <fullTextUrl format="html">http://istrazivanja.ff.uns.ac.rs/index.php/istr/article/view/2127</fullTextUrl>
    <keywords language="eng"/>
    <keywords language=""/>
    <keywords language="srp"/>
    <keywords language="srp"/>
  </record>
  <record>
    <language>eng</language>
    <publisher>Filozofski fakultet u Novom Sadu</publisher>
    <journalTitle>ISTRAŽIVANJA, Јournal of Historical Researches</journalTitle>
    <issn>0350-2112</issn>
    <eissn>2406-1131</eissn>
    <publicationDate>2018-12-26</publicationDate>
    <issue>29</issue>
    <startPage>198</startPage>
    <endPage>200</endPage>
    <doi>10.19090/i.2018.29.198-200</doi>
    <publisherRecordId>2126</publisherRecordId>
    <title language="eng">Niall Ferguson, Kissinger: 1923-1968. The Idealist, New York: Penguin Press, 2015, 987 pages.</title>
    <authors>
      <author>
        <name>Aleksandar M. Gajić</name>
        <email>aa@aa.aaa</email>
      </author>
    </authors>
    <abstract language="eng">
   
</abstract>
    <fullTextUrl format="html">http://istrazivanja.ff.uns.ac.rs/index.php/istr/article/view/2126</fullTextUrl>
    <keywords language="eng"/>
    <keywords language=""/>
    <keywords language="srp"/>
    <keywords language="srp"/>
  </record>
  <record>
    <language>eng</language>
    <publisher>Filozofski fakultet u Novom Sadu</publisher>
    <journalTitle>ISTRAŽIVANJA, Јournal of Historical Researches</journalTitle>
    <issn>0350-2112</issn>
    <eissn>2406-1131</eissn>
    <publicationDate>2018-12-26</publicationDate>
    <issue>29</issue>
    <startPage>197</startPage>
    <endPage>198</endPage>
    <doi>10.19090/i.2018.29.197-198</doi>
    <publisherRecordId>2125</publisherRecordId>
    <title language="eng">Boris Kršev, Securitas Res Publica – A Short History of Security, Novi Sad: Prometej, 2017, pp. 393.</title>
    <authors>
      <author>
        <name>Slobodan Bjelica</name>
        <email>sbjelica@ff.uns.ac.rs</email>
        <affiliationId>0</affiliationId>
      </author>
    </authors>
    <affiliationsList>
      <affiliationName affiliationId="0">Faculty of Philosophy, Novi Sad</affiliationName>
    </affiliationsList>
    <abstract language="eng">
   
</abstract>
    <fullTextUrl format="html">http://istrazivanja.ff.uns.ac.rs/index.php/istr/article/view/2125</fullTextUrl>
    <keywords language="eng"/>
    <keywords language=""/>
    <keywords language="srp"/>
    <keywords language="srp"/>
  </record>
  <record>
    <language>eng</language>
    <publisher>Filozofski fakultet u Novom Sadu</publisher>
    <journalTitle>ISTRAŽIVANJA, Јournal of Historical Researches</journalTitle>
    <issn>0350-2112</issn>
    <eissn>2406-1131</eissn>
    <publicationDate>2018-12-26</publicationDate>
    <issue>29</issue>
    <startPage>194</startPage>
    <endPage>196</endPage>
    <doi>10.19090/i.2018.29.194-196</doi>
    <publisherRecordId>2124</publisherRecordId>
    <title language="eng">Nenad Ninković, Mitropolit Pavle Nenadović, Novi Sad – Sremska Mitrovica: Faculty of Philosophy in Novi Sad, Historical Archive Srem, 2017, pp. 536.</title>
    <authors>
      <author>
        <name>Goran Vasin</name>
        <email>goran.vasin@ff.uns.ac.rs</email>
        <affiliationId>0</affiliationId>
      </author>
    </authors>
    <affiliationsList>
      <affiliationName affiliationId="0">Faculty of Philosophy, Novi Sad</affiliationName>
    </affiliationsList>
    <abstract language="eng">
   
</abstract>
    <fullTextUrl format="html">http://istrazivanja.ff.uns.ac.rs/index.php/istr/article/view/2124</fullTextUrl>
    <keywords language="eng"/>
    <keywords language=""/>
    <keywords language="srp"/>
    <keywords language="srp"/>
  </record>
</records>

Could not convert selected objects.

As I can see, there is error with language code, but I don’t see how to solve it?

do you know what is the missing language code there <keywords language=""/>?

Actually I have no idea, we have English, Serbian Latin and Serbian Cyrillic installed, is there a way to find empty language strings in database and clean them?

The nodes are created here: https://github.com/pkp/ojs/blob/master/plugins/importexport/doaj/filter/DOAJXmlFilter.inc.php#L173

You could check what the value of $locale is just before that line where it tries to fetch the three letter abbreviation for it. just add error_log(print_r($locale, true)); before that line and try to export again.