[opencms-dev] XML-Content xsd:choice

patric dosch patric.dosch at virtual-identity.com
Wed Sep 28 12:30:07 CEST 2011


Hey, 

 

You have to make the choice-element in your own schema. 

 

<xsd:complexType name="OpenCmsArticle">

<xsd:sequence>

              <xsd:element name="Title" type="OpenCmsString"/>      

[...]          

<xsd:element name="ContextTeaser" type="OpenCmsContextTeaser" minOccurs="0" maxOccurs="unbounded"/>

       </xsd:sequence>

<xsd:attribute name="language" type="OpenCmsLocale" use="required"/>

</xsd:complexType>

 

<xsd:complexType name="OpenCmsContextTeaser">

       <xsd:choice>

              <xsd:element name="TextTeaser" type="OpenCmsTextTeaser" minOccurs="0"/>

              <xsd:element name="LinkListTeaser" type="OpenCmsLinkListTeaser" minOccurs="0"/>         

              <xsd:element name="Contact" type="OpenCmsVfsFile" minOccurs="0"/>

       </xsd:choice>

       <xsd:attribute name="language" type="OpenCmsLocale" use="optional"/>

</xsd:complexType>

 

Regards, Patric

 

Von: opencms-dev-bounces at opencms.org [mailto:opencms-dev-bounces at opencms.org] Im Auftrag von Thomas Göttlich
Gesendet: Mittwoch, 28. September 2011 11:55
An: The OpenCms mailing list
Betreff: [opencms-dev] XML-Content xsd:choice

 

Hi, 

how would I use the xsd:choice element in my schemas?

Currently I tried the following but I get "invalid schema structure" errors:


<xsd:complexType name="OpenCmsTest">
    <xsd:sequence>
      <xsd:choice>
      <!-- 
        <xsd:element name="MT1" type="OpenCmsModule1" minOccurs="0" />
        <xsd:element name="MT2" type="OpenCmsModule2" minOccurs="0"  />
       -->
       <xsd:element name="Headline" type="OpenCmsString"
          minOccurs="1" maxOccurs="1" />
       <xsd:element name="Title" type="OpenCmsString"
        minOccurs="1" maxOccurs="1" />
      </xsd:choice>
    </xsd:sequence>
    
    <!-- 6. locale attribute is required -->
    <xsd:attribute name="language" type="OpenCmsLocale"
      use="optional"/>
  </xsd:complexType>

Unfortunately I did find any documentation or examples, just notes that it is now possible to use that.

Thanks in advance,

Thomas

_____________________________________________________________________
Vorstand: Ralf Heller, Udo Möbes
Vorsitzende des Aufsichtsrates: Kirsten Heller
Sitz der Gesellschaft: Gruenwaelderstrasse 10-14, D-79098 Freiburg
Amtsgericht Freiburg HRB 6218

Versand am 28.09.2011 12:30 von dosch patric
Validation-Code: 4055011134176

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://webmail.opencms.org/pipermail/opencms-dev/attachments/20110928/0e4f9a1e/attachment.htm>


More information about the opencms-dev mailing list