<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=us-ascii">
<meta name="Generator" content="Microsoft Word 14 (filtered medium)">
<style><!--
/* Font Definitions */
@font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0cm;
        margin-bottom:.0001pt;
        mso-add-space:auto;
        font-size:11.0pt;
        font-family:"Calibri","sans-serif";}
p.MsoNormalCxSpFirst, li.MsoNormalCxSpFirst, div.MsoNormalCxSpFirst
        {mso-style-type:export-only;
        margin:0cm;
        margin-bottom:.0001pt;
        mso-add-space:auto;
        font-size:11.0pt;
        font-family:"Calibri","sans-serif";}
p.MsoNormalCxSpMiddle, li.MsoNormalCxSpMiddle, div.MsoNormalCxSpMiddle
        {mso-style-type:export-only;
        margin:0cm;
        margin-bottom:.0001pt;
        mso-add-space:auto;
        font-size:11.0pt;
        font-family:"Calibri","sans-serif";}
p.MsoNormalCxSpLast, li.MsoNormalCxSpLast, div.MsoNormalCxSpLast
        {mso-style-type:export-only;
        margin:0cm;
        margin-bottom:.0001pt;
        mso-add-space:auto;
        font-size:11.0pt;
        font-family:"Calibri","sans-serif";}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:blue;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {mso-style-priority:99;
        color:purple;
        text-decoration:underline;}
span.EmailStyle17
        {mso-style-type:personal-compose;
        font-family:"Calibri","sans-serif";
        color:windowtext;}
.MsoChpDefault
        {mso-style-type:export-only;
        font-family:"Calibri","sans-serif";
        mso-fareast-language:EN-US;}
@page WordSection1
        {size:612.0pt 792.0pt;
        margin:70.85pt 70.85pt 70.85pt 70.85pt;}
div.WordSection1
        {page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]-->
</head>
<body lang="FR-CH" link="blue" vlink="purple">
<div class="WordSection1">
<p class="MsoNormalCxSpFirst"><font size="2" face="Calibri"><span lang="EN-GB" style="font-size:11.0pt">Hi Mark and list,<o:p></o:p></span></font></p>
<p class="MsoNormalCxSpMiddle"><font size="2" face="Calibri"><span lang="EN-GB" style="font-size:11.0pt"><o:p> </o:p></span></font></p>
<p class="MsoNormalCxSpMiddle"><font size="2" face="Calibri"><span lang="EN-GB" style="font-size:11.0pt">I’m not sure if this is a XML::Compile question or just proof that I need training on XML.<o:p></o:p></span></font></p>
<p class="MsoNormalCxSpMiddle"><font size="2" face="Calibri"><span lang="EN-GB" style="font-size:11.0pt"><o:p> </o:p></span></font></p>
<p class="MsoNormalCxSpMiddle"><font size="2" face="Calibri"><span lang="EN-GB" style="font-size:11.0pt">I have a schema that contains a section like this:<o:p></o:p></span></font></p>
<p class="MsoNormalCxSpMiddle"><font size="2" face="Calibri"><span lang="EN-GB" style="font-size:11.0pt"><o:p> </o:p></span></font></p>
<p class="MsoNormalCxSpMiddle"><font size="2" face="Calibri"><span lang="EN-GB" style="font-size:11.0pt"><xs:element minOccurs="0" name="contents"><o:p></o:p></span></font></p>
<p class="MsoNormalCxSpMiddle"><font size="2" face="Calibri"><span lang="EN-GB" style="font-size:11.0pt"><xs:complexType><o:p></o:p></span></font></p>
<p class="MsoNormalCxSpMiddle"><font size="2" face="Calibri"><span lang="EN-GB" style="font-size:11.0pt"><xs:sequence><o:p></o:p></span></font></p>
<p class="MsoNormalCxSpMiddle"><font size="2" face="Calibri"><span lang="EN-GB" style="font-size:11.0pt"><xs:element maxOccurs="unbounded" minOccurs="0" name="component"><o:p></o:p></span></font></p>
<p class="MsoNormalCxSpMiddle"><font size="2" face="Calibri"><span lang="EN-GB" style="font-size:11.0pt"><xs:complexType><o:p></o:p></span></font></p>
<p class="MsoNormalCxSpMiddle"><font size="2" face="Calibri"><span lang="EN-GB" style="font-size:11.0pt"><xs:choice><o:p></o:p></span></font></p>
<p class="MsoNormalCxSpMiddle"><font size="2" face="Calibri"><span lang="EN-GB" style="font-size:11.0pt"><xs:element minOccurs="0" name="csRef"><o:p></o:p></span></font></p>
<p class="MsoNormalCxSpMiddle"><font size="2" face="Calibri"><span lang="EN-GB" style="font-size:11.0pt"><xs:annotation><o:p></o:p></span></font></p>
<p class="MsoNormalCxSpMiddle"><font size="2" face="Calibri"><span lang="EN-GB" style="font-size:11.0pt"><xs:documentation>This element can be used to referenced when the content is already<o:p></o:p></span></font></p>
<p class="MsoNormalCxSpMiddle"><font size="2" face="Calibri"><span lang="EN-GB" style="font-size:11.0pt">stored in a content repository.<o:p></o:p></span></font></p>
<p class="MsoNormalCxSpMiddle"><font size="2" face="Calibri"><span lang="EN-GB" style="font-size:11.0pt">In the case of uploading the content, it must not be present.<o:p></o:p></span></font></p>
<p class="MsoNormalCxSpMiddle"><font size="2" face="Calibri"><span style="font-size:11.0pt"></xs:documentation><o:p></o:p></span></font></p>
<p class="MsoNormalCxSpMiddle"><font size="2" face="Calibri"><span style="font-size:11.0pt"></xs:annotation><o:p></o:p></span></font></p>
<p class="MsoNormalCxSpMiddle"><font size="2" face="Calibri"><span style="font-size:11.0pt"><xs:complexType><o:p></o:p></span></font></p>
<p class="MsoNormalCxSpMiddle"><font size="2" face="Calibri"><span lang="EN-GB" style="font-size:11.0pt"><xs:sequence><o:p></o:p></span></font></p>
<p class="MsoNormalCxSpMiddle"><font size="2" face="Calibri"><span lang="EN-GB" style="font-size:11.0pt"><xs:element name="csId" type="csIdType"/><o:p></o:p></span></font></p>
<p class="MsoNormalCxSpMiddle"><font size="2" face="Calibri"><span lang="EN-GB" style="font-size:11.0pt"><xs:element name="contentId" type="xs:string"/><o:p></o:p></span></font></p>
<p class="MsoNormalCxSpMiddle"><font size="2" face="Calibri"><span lang="EN-GB" style="font-size:11.0pt"></xs:sequence><o:p></o:p></span></font></p>
<p class="MsoNormalCxSpMiddle"><font size="2" face="Calibri"><span lang="EN-GB" style="font-size:11.0pt"></xs:complexType><o:p></o:p></span></font></p>
<p class="MsoNormalCxSpMiddle"><font size="2" face="Calibri"><span lang="EN-GB" style="font-size:11.0pt"></xs:element><o:p></o:p></span></font></p>
<p class="MsoNormalCxSpMiddle"><font size="2" face="Calibri"><span lang="EN-GB" style="font-size:11.0pt"></xs:choice><o:p></o:p></span></font></p>
<p class="MsoNormalCxSpMiddle"><font size="2" face="Calibri"><span lang="EN-GB" style="font-size:11.0pt"><o:p> </o:p></span></font></p>
<p class="MsoNormalCxSpMiddle"><font size="2" face="Calibri"><span lang="EN-GB" style="font-size:11.0pt"><o:p> </o:p></span></font></p>
<p class="MsoNormalCxSpMiddle"><font size="2" face="Calibri"><span lang="EN-GB" style="font-size:11.0pt">In perl I build a structure like this:<o:p></o:p></span></font></p>
<p class="MsoNormalCxSpMiddle"><font size="2" face="Calibri"><span lang="EN-GB" style="font-size:11.0pt"><o:p> </o:p></span></font></p>
<p class="MsoNormalCxSpMiddle"><font size="2" face="Calibri"><span lang="EN-GB" style="font-size:11.0pt"> contents => {<o:p></o:p></span></font></p>
<p class="MsoNormalCxSpMiddle"><font size="2" face="Calibri"><span lang="EN-GB" style="font-size:11.0pt"> component => [
<o:p></o:p></span></font></p>
<p class="MsoNormalCxSpMiddle"><font size="2" face="Calibri"><span lang="EN-GB" style="font-size:11.0pt"> {
<o:p></o:p></span></font></p>
<p class="MsoNormalCxSpMiddle"><font size="2" face="Calibri"><span lang="EN-GB" style="font-size:11.0pt"> csRef => { csId => 'fld', contentId => 'docid', },<o:p></o:p></span></font></p>
<p class="MsoNormalCxSpMiddle"><font size="2" face="Calibri"><span lang="EN-GB" style="font-size:11.0pt"> title => 'PerlTest',<o:p></o:p></span></font></p>
<p class="MsoNormalCxSpMiddle"><font size="2" face="Calibri"><span lang="EN-GB" style="font-size:11.0pt"> mimeType => 'text/plain',<o:p></o:p></span></font></p>
<p class="MsoNormalCxSpMiddle"><font size="2" face="Calibri"><span lang="EN-GB" style="font-size:11.0pt"> fileExtension => 'txt',<o:p></o:p></span></font></p>
<p class="MsoNormalCxSpMiddle"><font size="2" face="Calibri"><span lang="EN-GB" style="font-size:11.0pt"> lang => 'fr',<o:p></o:p></span></font></p>
<p class="MsoNormalCxSpMiddle"><font size="2" face="Calibri"><span lang="EN-GB" style="font-size:11.0pt"> },<o:p></o:p></span></font></p>
<p class="MsoNormalCxSpMiddle"><font size="2" face="Calibri"><span lang="EN-GB" style="font-size:11.0pt"> ],<o:p></o:p></span></font></p>
<p class="MsoNormalCxSpMiddle"><font size="2" face="Calibri"><span lang="EN-GB" style="font-size:11.0pt"><o:p> </o:p></span></font></p>
<p class="MsoNormalCxSpMiddle"><font size="2" face="Calibri"><span lang="EN-GB" style="font-size:11.0pt"><o:p> </o:p></span></font></p>
<p class="MsoNormalCxSpMiddle"><font size="2" face="Calibri"><span lang="EN-GB" style="font-size:11.0pt">The above fragment will be converted to XML by XML::Compile::Schema. However if I don’t specify the csRef, it refuses to convert to XML, and gives me the
error<o:p></o:p></span></font></p>
<p class="MsoNormalCxSpMiddle"><font size="2" face="Calibri"><span lang="EN-GB" style="font-size:11.0pt"><o:p> </o:p></span></font></p>
<p class="MsoNormalCxSpMiddle"><font size="2" face="Calibri"><span lang="EN-GB" style="font-size:11.0pt">error: no match for required block `cho_csRef' at node/contents/component<o:p></o:p></span></font></p>
<p class="MsoNormalCxSpMiddle"><font size="2" face="Calibri"><span lang="EN-GB" style="font-size:11.0pt"><o:p> </o:p></span></font></p>
<p class="MsoNormalCxSpMiddle"><font size="2" face="Calibri"><span lang="EN-GB" style="font-size:11.0pt">The schema does say minOccurs="0", so I don’t know why I have to provide it.
<o:p></o:p></span></font></p>
<p class="MsoNormalCxSpMiddle"><font size="2" face="Calibri"><span lang="EN-GB" style="font-size:11.0pt">However the xs:choice does seem required, so I understand the error.<o:p></o:p></span></font></p>
<p class="MsoNormalCxSpMiddle"><font size="2" face="Calibri"><span lang="EN-GB" style="font-size:11.0pt">Is the schema just bad ?<o:p></o:p></span></font></p>
<p class="MsoNormalCxSpMiddle"><font size="2" face="Calibri"><span lang="EN-GB" style="font-size:11.0pt"><o:p> </o:p></span></font></p>
<p class="MsoNormalCxSpMiddle"><font size="2" face="Calibri"><span lang="EN-GB" style="font-size:11.0pt">Thanks for any pointers,<o:p></o:p></span></font></p>
<p class="MsoNormalCxSpMiddle"><font size="2" face="Calibri"><span lang="EN-GB" style="font-size:11.0pt"><o:p> </o:p></span></font></p>
<p class="MsoNormalCxSpMiddle"><font size="2" face="Calibri"><span lang="EN-GB" style="font-size:11.0pt">Ciaran Deignan<o:p></o:p></span></font></p>
<p class="MsoNormalCxSpMiddle"><font size="2" face="Calibri"><span lang="EN-GB" style="font-size:11.0pt">RSD Technical Support<o:p></o:p></span></font></p>
<p class="MsoNormalCxSpLast"><font size="2" face="Calibri"><span lang="EN-GB" style="font-size:11.0pt"><o:p> </o:p></span></font></p>
</div>
</body>
</html>