oasis-tcs / lexidma

OASIS Lexicographic Infrastructure Data Model and API (LEXIDMA) TC: A repository designed for use in development of TC chartered work products and test suites. https://github.com/oasis-tcs/lexidma
Other
7 stars 8 forks source link

XSD schema breaking issue #135

Closed DavidFatDavidF closed 2 months ago

DavidFatDavidF commented 2 months ago

XSD schema rejects entries, sense or collocateMarkers without @id. This attribute is marked as optional in the specification but is not in the XSD. Even more confusingly it only fails if the root element is lexicographicResource not when the element is entry. This means that examples A.1.21-23 pass the validation, but will fail if they are used within a lexicographicResource.

jmccrae commented 2 months ago

To reproduce check the following file

<lexicographicResource langCode="en"
    xmlns="http://docs.oasis-open.org/lexidma/ns/dmlex-1.0">
    <entry id="autopsy">
        <headword>autopsy</headword>
        <sense id="autopsy-1">
            <example>
                <text>The coroner <collocateMarker lemma="perform">performed</collocateMarker> an <headwordMarker>autopsy</headwordMarker>.</text>
                <exampleTranslation langCode="cs">
                    <text>Koroner <collocateMarker lemma="provést">provedl</collocateMarker> <headwordMarker>pitvu</headwordMarker>.</text>
                </exampleTranslation>
            </example>
            <headwordTranslation langCode="cs"><text>pitva</text></headwordTranslation>
        </sense>
    </entry>
    <translationLanguage langCode="cs"/>
</lexicographicResource>

According to this Stackoverflow Post, the change needs to be at this line https://github.com/oasis-tcs/lexidma/blob/f833bcc78bba9f5551a4eff75a64d8673bffbbc1/dmlex-v1.0/specification/schemas/XML/dmlex.xsd#L92

Simply changing the element to xs:unique