[DDI-users] DDI 3.2: Schema allows double identification sequence

Jani Hautamäki Jani.Hautamaki at staff.uta.fi
Wed Dec 3 17:16:22 EST 2014


In DDI-Lifecycle 3.2 the narrative documentation

http://www.ddialliance.org/Specification/DDI-Lifecycle/3.2/XMLSchema/FieldLevelDocumentation/schemas/reusable_xsd/complexTypes/AbstractIdentifiableType.html

for the type

{ddi:reusable:3_2}AbstractIdentifiableType

states that

"An entity can either be identified either by a URN and/or an identification
sequence. At a minimum, one or the other is required. "

However, according to the XML Schema, the following XML document is valid.

---8<---8<---8<---
<?xml version="1.0" encoding="utf-8"?>
<ddi:DDIInstance
    xmlns:ddi="ddi:instance:3_2"
    xmlns:r="ddi:reusable:3_2"
    >

  <r:Agency>acme.org</r:Agency>
  <r:ID>ddi_instance</r:ID>
  <r:Version>1</r:Version>

  <r:Agency>acme.org</r:Agency>
  <r:ID>another_ddi_instance</r:ID>
  <r:Version>2</r:Version>

</ddi:DDIInstance>
---8<---8<---8<---

This is invalid according to specification, but the restriction
is not expressed formally with XML Schema.

My question is then:

Is this a mistake/bug in the XML Schema? (If not, please explain why
it is better to formally allow such invalid documents?)

The XML Schema language allows one to express formally the restriction
"either one or both". The details are laid down, for instance, in the answer
http://stackoverflow.com/questions/9863056/xsd-schema-either-one-or-both

Here's a patch for the file "reusable.xsd" that is included in the current
distribution package of the DDI-Lifecycle 3.2:


http://www.pastebucket.com/72481


-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.icpsr.umich.edu/pipermail/ddi-users/attachments/20141203/73b3e769/attachment.html 


More information about the DDI-users mailing list