Skip to content

Invalid xml:lang for concept elements

Created by: yytosi

Mapping from codebook to Kuha data model does not read xml:lang attributes correctly for elements that have a concept-child.

Reproduce:

  1. Import DDI2.5 with some element with a concept child, here timeMeth-element
    <?xml version="1.0"?>
    <codeBook version="2.5" xmlns="ddi:codebook:2_5" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="ddi:codebook:2_5 http://www.ddialliance.org/Specification/DDI-Codebook/2.5/XMLSchema/codebook.xsd">
      <stdyDscr>
        <citation>
          <titlStmt>
            <titl>testi</titl>
            <IDNo>1</IDNo>
          </titlStmt>
        </citation>
        <method>
          <dataColl>
            <timeMeth xml:lang="fi">Toistuva
              <concept>Repeated</concept>
            </timeMeth>
            <timeMeth xml:lang="en">Repeated
              <concept>Repeated</concept>
            </timeMeth>
          </dataColl>
        </method>
      </stdyDscr>
    </codeBook>

2. Fetch the document from docstore and see time_methods

    "time_methods": [
      {
        "system_name": null,
        "uri": null,
        "description": "Toistuva",
        "time_method": "Repeated",
        "language": "en"
      },
      {
        "system_name": null,
        "uri": null,
        "description": "Repeated",
        "time_method": "Repeated",
        "language": "en"
      }
    ],

Result: language is not ‘fi’ for the first container.

Expected:

"time_methods": [
  {
    "system_name": null,
    "uri": null,
    "description": "Toistuva",
    "time_method": "Repeated",
    "language": "fi"
  },
  {
    "system_name": null,
    "uri": null,
    "description": "Repeated",
    "time_method": "Repeated",
    "language": "en"
  }
],