<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1">
<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 name=Generator content="Microsoft Word 14 (filtered medium)"><style><!--
/* Font Definitions */
@font-face
        {font-family:"Cambria Math";
        panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
        {font-family:Tahoma;
        panose-1:2 11 6 4 3 5 4 4 2 4;}
@font-face
        {font-family:Consolas;
        panose-1:2 11 6 9 2 2 4 3 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0cm;
        margin-bottom:.0001pt;
        font-size:12.0pt;
        font-family:"Times New Roman","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;}
p.MsoAcetate, li.MsoAcetate, div.MsoAcetate
        {mso-style-priority:99;
        mso-style-link:"Sprechblasentext Zchn";
        margin:0cm;
        margin-bottom:.0001pt;
        font-size:8.0pt;
        font-family:"Tahoma","sans-serif";}
span.E-MailFormatvorlage17
        {mso-style-type:personal-reply;
        font-family:"Calibri","sans-serif";
        color:#1F497D;}
span.SprechblasentextZchn
        {mso-style-name:"Sprechblasentext Zchn";
        mso-style-priority:99;
        mso-style-link:Sprechblasentext;
        font-family:"Tahoma","sans-serif";
        mso-fareast-language:DE;}
span.hps
        {mso-style-name:hps;}
.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 2.0cm 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=DE link=blue vlink=purple><div class=WordSection1><p class=MsoNormal><span class=hps><span lang=EN>The</span></span><span lang=EN> <span class=hps>error</span> <span class=hps>I</span> <span class=hps>unfortunately do not know</span>, <span class=hps>but my</span> <span class=hps>example is</span> <span class=hps>from a</span> <span class=hps>current</span> <span class=hps>project</span>. <span class=hps><o:p></o:p></span></span></p><p class=MsoNormal><span class=hps><span lang=EN>And your </span></span>language-node should be required in the test-schema.<o:p></o:p></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>Regards, Patric<span class=hps><span lang=EN><o:p></o:p></span></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'><o:p> </o:p></span></p><p class=MsoNormal><b><span style='font-size:10.0pt;font-family:"Tahoma","sans-serif"'>Von:</span></b><span style='font-size:10.0pt;font-family:"Tahoma","sans-serif"'> opencms-dev-bounces@opencms.org [mailto:opencms-dev-bounces@opencms.org] <b>Im Auftrag von </b>Thomas Göttlich<br><b>Gesendet:</b> Mittwoch, 28. September 2011 13:20<br><b>An:</b> The OpenCms mailing list<br><b>Betreff:</b> Re: [opencms-dev] XML-Content xsd:choice<o:p></o:p></span></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal style='margin-bottom:12.0pt'>Hi Patric,<br><br>thanks for the advice.<br><br>Does that mean I have to use an intermediate schema to define the choice?<br><br>Currently, I have this:<br><br>test.xsd    //my example below shows the complexType definition<br>module1.xsd  //a simple opencms schema to define a sub-module<br>module2.xsd  //another simple opencms schema to define a sub-module<br><br>So what I want to do is to have a list of "modules" (or elements) in the test files where the modules can be of one of those two types.<br><br>Creating another complextType in the test.xsd schema like the following, results in the error "Exactly 2 complex type definitions are required, not 3."<br><br> <!-- 3. Root element name and type of our XML type --><br>  <xsd:element name="Tests" type="OpenCmsTests"/><br><br>  <!-- 4. Definition of the type described above --><br>  <xsd:complexType name="OpenCmsTests"><br>    <xsd:sequence><br>      <xsd:element name="Test" type="OpenCmsTest"<br>        minOccurs="0" maxOccurs="unbounded"/><br>    </xsd:sequence><br>  </xsd:complexType><br>    <br>  <!-- 5. Data field definitions --><br>  <xsd:complexType name="OpenCmsTest"><br>    <xsd:sequence><br>      <!-- <br>        <xsd:element name="MT1" type="OpenCmsModule1" minOccurs="0" /><br>        <xsd:element name="MT2" type="OpenCmsModule2" minOccurs="0"  /><br>       --><br>       <xsd:element name="Text" type="OpenCmsText"<br>          minOccurs="0"/>            <br>    </xsd:sequence><br>    <br>    <!-- 6. locale attribute is required --><br>    <xsd:attribute name="language" type="OpenCmsLocale"<br>      use="optional"/><br>  </xsd:complexType><br>  <br>  <xsd:complexType name="OpenCmsText">   <br>    <xsd:choice>    <br>      <xsd:element name="Headline" type="OpenCmsString" minOccurs="0" /><br>       <xsd:element name="Title" type="OpenCmsString" minOccurs="0" />   <br>    </xsd:choice><br>    <br>    <xsd:attribute name="language" type="OpenCmsLocale" use="optional"/>    <br>  </xsd:complexType><br><br>Note that the names are just arbitrary chosen, in order to do some tests.<br><br>Should the structure instead be like this?<br><br>test.xsd    //this would contain a list of the type defined by modulechoice.xsd<br>modulechoice.xsd //would only contain the element with the xsd:choice between the modules<br>module1.xsd  //a simple opencms schema to define a sub-module<br>module2.xsd  //another simple opencms schema to define a sub-module<br><br><br>Thanks for your effort.<br><br><br>Regards,<br><br>Thomas<o:p></o:p></p><div><p class=MsoNormal>2011/9/28 patric dosch <<a href="mailto:patric.dosch@virtual-identity.com">patric.dosch@virtual-identity.com</a>><o:p></o:p></p><div><div><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'><span style='font-size:11.0pt;color:#1F497D'>Hey, </span><o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'><span style='font-size:11.0pt;color:#1F497D'> </span><o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'><span style='font-size:11.0pt;color:#1F497D'>You have to make the choice-element in your own schema. </span><o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;text-autospace:none'><span style='font-size:10.0pt;font-family:Consolas;color:teal'> </span><o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;text-autospace:none'><span style='font-size:10.0pt;font-family:Consolas;color:teal'><</span><span style='font-size:10.0pt;font-family:Consolas;color:#3F7F7F;background:silver'>xsd:complexType</span><span style='font-size:10.0pt;font-family:Consolas'> <span style='color:#7F007F'>name</span><span style='color:black'>=</span><i><span style='color:#2A00FF'>"OpenCmsArticle"</span></i><span style='color:teal'>></span></span><o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;text-indent:35.4pt;text-autospace:none'><span style='font-size:10.0pt;font-family:Consolas;color:teal'><</span><span style='font-size:10.0pt;font-family:Consolas;color:#3F7F7F'>xsd:sequence</span><span style='font-size:10.0pt;font-family:Consolas;color:teal'>></span><o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;text-autospace:none'><span style='font-size:10.0pt;font-family:Consolas;color:teal'><</span><span style='font-size:10.0pt;font-family:Consolas;color:#3F7F7F'>xsd:element</span><span style='font-size:10.0pt;font-family:Consolas'> <span style='color:#7F007F'>name</span><span style='color:black'>=</span><i><span style='color:#2A00FF'>"Title"</span></i> <span style='color:#7F007F'>type</span><span style='color:black'>=</span><i><span style='color:#2A00FF'>"<u>OpenCmsString</u>"</span></i><span style='color:teal'>/></span><span style='color:black'> </span></span><o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;margin-left:35.4pt;text-indent:35.4pt;text-autospace:none'><span style='font-size:10.0pt;font-family:Consolas;color:black'>[…] </span><o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;margin-left:35.4pt;text-indent:35.4pt;text-autospace:none'><span style='font-size:10.0pt;font-family:Consolas;color:teal'><</span><span style='font-size:10.0pt;font-family:Consolas;color:#3F7F7F'>xsd:element</span><span style='font-size:10.0pt;font-family:Consolas'> <span style='color:#7F007F'>name</span><span style='color:black'>=</span><i><span style='color:#2A00FF'>"ContextTeaser"</span></i> <span style='color:#7F007F'>type</span><span style='color:black'>=</span><i><span style='color:#2A00FF'>"</span><u><span style='color:#F79646'>OpenCmsContextTeaser</span></u><span style='color:#2A00FF'>"</span></i> <span style='color:#7F007F'>minOccurs</span><span style='color:black'>=</span><i><span style='color:#2A00FF'>"0"</span></i> <span style='color:#7F007F'>maxOccurs</span><span style='color:black'>=</span><i><span style='color:#2A00FF'>"unbounded"</span></i><span style='color:teal'>/></span></span><o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;text-autospace:none'><span style='font-size:10.0pt;font-family:Consolas;color:teal'></</span><span style='font-size:10.0pt;font-family:Consolas;color:#3F7F7F'>xsd:sequence</span><span style='font-size:10.0pt;font-family:Consolas;color:teal'>></span><o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;text-indent:35.4pt;text-autospace:none'><span style='font-size:10.0pt;font-family:Consolas;color:teal'><</span><span style='font-size:10.0pt;font-family:Consolas;color:#3F7F7F'>xsd:attribute</span><span style='font-size:10.0pt;font-family:Consolas'> <span style='color:#7F007F'>name</span><span style='color:black'>=</span><i><span style='color:#2A00FF'>"language"</span></i> <span style='color:#7F007F'>type</span><span style='color:black'>=</span><i><span style='color:#2A00FF'>"<u>OpenCmsLocale</u>"</span></i> <span style='color:#7F007F'>use</span><span style='color:black'>=</span><i><span style='color:#2A00FF'>"required"</span></i><span style='color:teal'>/></span></span><o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'><span style='font-size:10.0pt;font-family:Consolas;color:teal'></</span><span style='font-size:10.0pt;font-family:Consolas;color:#3F7F7F;background:silver'>xsd:complexType</span><span style='font-size:10.0pt;font-family:Consolas;color:teal'>></span><o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'><span style='font-size:11.0pt;color:#1F497D'> </span><o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;text-autospace:none'><span style='font-size:10.0pt;font-family:Consolas;color:teal'><</span><span style='font-size:10.0pt;font-family:Consolas;color:#3F7F7F'>xsd:complexType</span><span style='font-size:10.0pt;font-family:Consolas'> <span style='color:#7F007F'>name</span><span style='color:black'>=</span><i><span style='color:#2A00FF'>"</span><span style='color:#F79646'>OpenCmsContextTeaser</span><span style='color:#2A00FF'>"</span></i><span style='color:teal'>></span></span><o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;text-autospace:none'><span style='font-size:10.0pt;font-family:Consolas;color:teal'><</span><span style='font-size:10.0pt;font-family:Consolas;color:#3F7F7F'>xsd:choice</span><span style='font-size:10.0pt;font-family:Consolas;color:teal'>></span><o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;text-autospace:none'><span style='font-size:10.0pt;font-family:Consolas;color:teal'><</span><span style='font-size:10.0pt;font-family:Consolas;color:#3F7F7F'>xsd:element</span><span style='font-size:10.0pt;font-family:Consolas'> <span style='color:#7F007F'>name</span><span style='color:black'>=</span><i><span style='color:#2A00FF'>"TextTeaser"</span></i> <span style='color:#7F007F'>type</span><span style='color:black'>=</span><i><span style='color:#2A00FF'>"<u>OpenCmsTextTeaser</u>" </span></i><span style='color:#7F007F'>minOccurs</span><span style='color:black'>=</span><i><span style='color:#2A00FF'>"0"</span></i><span style='color:teal'>/></span></span><o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;text-autospace:none'><span style='font-size:10.0pt;font-family:Consolas;color:teal'><</span><span style='font-size:10.0pt;font-family:Consolas;color:#3F7F7F'>xsd:element</span><span style='font-size:10.0pt;font-family:Consolas'> <span style='color:#7F007F'>name</span><span style='color:black'>=</span><i><span style='color:#2A00FF'>"LinkListTeaser"</span></i> <span style='color:#7F007F'>type</span><span style='color:black'>=</span><i><span style='color:#2A00FF'>"<u>OpenCmsLinkListTeaser</u>"</span></i> <span style='color:#7F007F'>minOccurs</span><span style='color:black'>=</span><i><span style='color:#2A00FF'>"0"</span></i><span style='color:teal'>/></span><span style='color:black'> </span></span><o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;text-autospace:none'><span style='font-size:10.0pt;font-family:Consolas;color:teal'><</span><span style='font-size:10.0pt;font-family:Consolas;color:#3F7F7F'>xsd:element</span><span style='font-size:10.0pt;font-family:Consolas'> <span style='color:#7F007F'>name</span><span style='color:black'>=</span><i><span style='color:#2A00FF'>"Contact"</span></i> <span style='color:#7F007F'>type</span><span style='color:black'>=</span><i><span style='color:#2A00FF'>"<u>OpenCmsVfsFile</u>"</span></i> <span style='color:#7F007F'>minOccurs</span><span style='color:black'>=</span><i><span style='color:#2A00FF'>"0"</span></i><span style='color:teal'>/></span></span><o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;text-autospace:none'><span style='font-size:10.0pt;font-family:Consolas;color:teal'></</span><span style='font-size:10.0pt;font-family:Consolas;color:#3F7F7F'>xsd:choice</span><span style='font-size:10.0pt;font-family:Consolas;color:teal'>></span><o:p></o:p></p><div><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;text-autospace:none'><span style='font-size:10.0pt;font-family:Consolas;color:teal'><</span><span style='font-size:10.0pt;font-family:Consolas;color:#3F7F7F'>xsd:attribute</span><span style='font-size:10.0pt;font-family:Consolas'> <span style='color:#7F007F'>name</span><span style='color:black'>=</span><i><span style='color:#2A00FF'>"language"</span></i> <span style='color:#7F007F'>type</span><span style='color:black'>=</span><i><span style='color:#2A00FF'>"<u>OpenCmsLocale</u>"</span></i> <span style='color:#7F007F'>use</span><span style='color:black'>=</span><i><span style='color:#2A00FF'>"optional"</span></i><span style='color:teal'>/></span></span><o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'><span style='font-size:10.0pt;font-family:Consolas;color:teal'></</span><span style='font-size:10.0pt;font-family:Consolas;color:#3F7F7F'>xsd:complexType</span><span style='font-size:10.0pt;font-family:Consolas;color:teal'>></span><o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'><span style='font-size:10.0pt;font-family:Consolas;color:teal'> </span><o:p></o:p></p></div><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'><span style='font-size:11.0pt;color:#1F497D'>Regards, Patric</span><o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'><span style='font-size:11.0pt;color:#1F497D'> </span><o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'><b><span style='font-size:10.0pt'>Von:</span></b><span style='font-size:10.0pt'> <a href="mailto:opencms-dev-bounces@opencms.org" target="_blank">opencms-dev-bounces@opencms.org</a> [mailto:<a href="mailto:opencms-dev-bounces@opencms.org" target="_blank">opencms-dev-bounces@opencms.org</a>] <b>Im Auftrag von </b>Thomas Göttlich<br><b>Gesendet:</b> Mittwoch, 28. September 2011 11:55<br><b>An:</b> The OpenCms mailing list<br><b>Betreff:</b> [opencms-dev] XML-Content xsd:choice</span><o:p></o:p></p><div><div><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'> <o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'>Hi, <br><br>how would I use the xsd:choice element in my schemas?<br><br>Currently I tried the following but I get "invalid schema structure" errors:<br><br><br><xsd:complexType name="OpenCmsTest"><br>    <xsd:sequence><br>      <xsd:choice><br>      <!-- <br>        <xsd:element name="MT1" type="OpenCmsModule1" minOccurs="0" /><br>        <xsd:element name="MT2" type="OpenCmsModule2" minOccurs="0"  /><br>       --><br>       <xsd:element name="Headline" type="OpenCmsString"<br>          minOccurs="1" maxOccurs="1" /><br>       <xsd:element name="Title" type="OpenCmsString"<br>        minOccurs="1" maxOccurs="1" /><br>      </xsd:choice><br>    </xsd:sequence><br>    <br>    <!-- 6. locale attribute is required --><br>    <xsd:attribute name="language" type="OpenCmsLocale"<br>      use="optional"/><br>  </xsd:complexType><br><br>Unfortunately I did find any documentation or examples, just notes that it is now possible to use that.<br><br>Thanks in advance,<br><br>Thomas<o:p></o:p></p></div></div></div><p class=MsoNormal style='margin-bottom:12.0pt'><br><span style='font-size:8.0pt;font-family:"Arial","sans-serif";color:darkgray'>_____________________________________________________________________<br><br>Vorstand: Ralf Heller, Udo Möbes <br>Vorsitzende des Aufsichtsrates: Kirsten Heller <br>Sitz der Gesellschaft: Gruenwaelderstrasse 10-14, D-79098 Freiburg <br>Amtsgericht Freiburg HRB 6218<br><br>Versand am 28.09.2011 12:30 von dosch patric<br>Validation-Code: 4055011134176</span><o:p></o:p></p></div><p class=MsoNormal><br><br>_______________________________________________<br>This mail is sent to you from the opencms-dev mailing list<br>To change your list options, or to unsubscribe from the list, please visit<br><a href="http://lists.opencms.org/mailman/listinfo/opencms-dev" target="_blank">http://lists.opencms.org/mailman/listinfo/opencms-dev</a><o:p></o:p></p></div><p class=MsoNormal><o:p> </o:p></p></div></body></html>