<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<style type="text/css" style="display:none"><!--P{margin-top:0;margin-bottom:0;} --></style>
</head>
<body dir="ltr">
<div id="divtagdefaultwrapper" style="font-size:12pt;color:#000000;background-color:#FFFFFF;font-family:Calibri,Arial,Helvetica,sans-serif;">
<p>From what you said I get the impression that it is a bug in the XML Schema. Intension is expressed in the specifcation, but incapable of formulating the restriction in XML Schema. Is this correct?<br>
</p>
<p><br>
</p>
<p>The patch was included in the message and the resulting .xsd was tested against libxml2 v2.7.8. The patched schema worked just as intended. Including the patch in the XML Schema would reduce the number of documents that formally valid but invalid according
 to the specification.</p>
<p><br>
</p>
<p>Of course, accepting the fix to the schema would imply that also the similar structure in the ReferenceType should be fixed in&nbsp;a similar manner. However, in my opinion, this would only be a good thing to happen...</p>
<p><br>
</p>
<div style="color: rgb(33, 33, 33);">
<hr tabindex="-1" style="display:inline-block; width:98%">
<div id="divRplyFwdMsg" dir="ltr"><font style="font-size:11pt" color="#000000" face="Calibri, sans-serif"><b>From:</b> ddi-users-bounces@icpsr.umich.edu &lt;ddi-users-bounces@icpsr.umich.edu&gt; on behalf of Wendy Thomas &lt;wlt@umn.edu&gt;<br>
<b>Sent:</b> Thursday, December 4, 2014 00:27<br>
<b>To:</b> Data Documentation Initiative Users Group<br>
<b>Subject:</b> Re: [DDI-users] DDI 3.2: Schema allows double identification sequence</font>
<div>&nbsp;</div>
</div>
<div>
<div dir="ltr">Yes we know about this but have been unable in XML to allow only one of each but require at least one or the other. We have had the bug filed since version 3.0. The best we could do was document what was supposed to be done.&nbsp;
<div><br>
</div>
<div>URL OR sequence OR both is the intention and so documented.</div>
<div><br>
</div>
<div>However 2 URLs or 2 sequences will validate in the XML</div>
<div><br>
</div>
<div>Wendy</div>
<div><br>
</div>
</div>
<div class="gmail_extra"><br>
<div class="gmail_quote">On Wed, Dec 3, 2014 at 4:16 PM, Jani Hautamäki <span dir="ltr">
&lt;<a href="mailto:Jani.Hautamaki@staff.uta.fi" target="_blank">Jani.Hautamaki@staff.uta.fi</a>&gt;</span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex; border-left:1px #ccc solid; padding-left:1ex">
<div dir="ltr">
<div style="font-size:12pt; color:#000000; background-color:#ffffff; font-family:Calibri,Arial,Helvetica,sans-serif">
<p>In DDI-Lifecycle 3.2 the narrative documentation <br>
<br>
<a href="http://www.ddialliance.org/Specification/DDI-Lifecycle/3.2/XMLSchema/FieldLevelDocumentation/schemas/reusable_xsd/complexTypes/AbstractIdentifiableType.html" target="_blank">http://www.ddialliance.org/Specification/DDI-Lifecycle/3.2/XMLSchema/FieldLevelDocumentation/schemas/reusable_xsd/complexTypes/AbstractIdentifiableType.html</a><br>
<br>
for the type<br>
<br>
{ddi:reusable:3_2}AbstractIdentifiableType<br>
<br>
states that<br>
<br>
&quot;An entity can either be identified either by a URN and/or an identification <br>
sequence. At a minimum, one or the other is required. &quot;<br>
<br>
However, according to the XML Schema, the following XML document is valid.<br>
<br>
---8&lt;---8&lt;---8&lt;---<br>
&lt;?xml version=&quot;1.0&quot; encoding=&quot;utf-8&quot;?&gt;<br>
&lt;ddi:DDIInstance <br>
&nbsp;&nbsp;&nbsp; xmlns:ddi=&quot;ddi:instance:3_2&quot; <br>
&nbsp;&nbsp;&nbsp; xmlns:r=&quot;ddi:reusable:3_2&quot; <br>
&nbsp;&nbsp;&nbsp; &gt;<br>
&nbsp;&nbsp; &nbsp;<br>
&nbsp; &lt;r:Agency&gt;<a href="http://acme.org" target="_blank">acme.org</a>&lt;/r:Agency&gt;<br>
&nbsp; &lt;r:ID&gt;ddi_instance&lt;/r:ID&gt;<br>
&nbsp; &lt;r:Version&gt;1&lt;/r:Version&gt;<br>
&nbsp; <br>
&nbsp; &lt;r:Agency&gt;<a href="http://acme.org" target="_blank">acme.org</a>&lt;/r:Agency&gt;<br>
&nbsp; &lt;r:ID&gt;another_ddi_instance&lt;/r:ID&gt;<br>
&nbsp; &lt;r:Version&gt;2&lt;/r:Version&gt;<br>
&nbsp; <br>
&lt;/ddi:DDIInstance&gt;<br>
---8&lt;---8&lt;---8&lt;---<br>
<br>
This is invalid according to specification, but the restriction<br>
is not expressed formally with XML Schema.<br>
<br>
My question is then:<br>
<br>
Is this a mistake/bug in the XML Schema? (If not, please explain why<br>
it is better to formally allow such invalid documents?)<br>
<br>
The XML Schema language allows one to express formally the restriction <br>
&quot;either one or both&quot;. The details are laid down, for instance, in the answer<br>
<a href="http://stackoverflow.com/questions/9863056/xsd-schema-either-one-or-both" target="_blank">http://stackoverflow.com/questions/9863056/xsd-schema-either-one-or-both</a><br>
<br>
Here's a patch for the file &quot;reusable.xsd&quot; that is included in the current<br>
distribution package of the DDI-Lifecycle 3.2:</p>
<p><br>
</p>
<p><a href="http://www.pastebucket.com/72481" target="_blank">http://www.pastebucket.com/72481</a></p>
<p><br>
</p>
<p><br>
</p>
</div>
</div>
<br>
_______________________________________________<br>
DDI-users mailing list<br>
<a href="mailto:DDI-users@icpsr.umich.edu">DDI-users@icpsr.umich.edu</a><br>
<a href="http://lists.icpsr.umich.edu/mailman/listinfo/ddi-users" target="_blank">http://lists.icpsr.umich.edu/mailman/listinfo/ddi-users</a><br>
<br>
</blockquote>
</div>
<br>
<br clear="all">
<div><br>
</div>
-- <br>
<div class="gmail_signature">
<div>Wendy L. Thomas&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;Phone: &#43;1 612.624.4389</div>
<div>Data Access Core Director&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;Fax:&nbsp;&nbsp; &#43;1 612.626.8375</div>
<div>Minnesota Population Center&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Email: <a href="mailto:wlt@umn.edu" target="_blank">
wlt@umn.edu</a></div>
<div>University of Minnesota</div>
<div>50 Willey Hall</div>
<div>225 19th Avenue South</div>
<div>Minneapolis, MN 55455</div>
</div>
</div>
</div>
</div>
</div>
</body>
</html>