[opencms-dev] XSD contents : minOccurs maxOccurs problems

Territorio Jordan-V. jordan.territorio at gmail.com
Tue May 6 09:46:20 CEST 2008


Hi,

I try to make a schemas for editing some blocks of informations, with: a
title, a text and an image. So i created a xsd schemas to be able to create
structured as I want. Here is my info_article.xsd :

<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema"
    elementFormDefault="qualified">

    <xsd:include schemaLocation="opencms://opencms-xmlcontent.xsd" />

    <xsd:element name="MyNews" type="OpenCmsMyNews" />

    <xsd:complexType name="OpenCmsMyNews">
        <xsd:sequence>
            <xsd:element name="MyNew" type="OpenCmsMyNew"
                minOccurs="0" maxOccurs="unbounded" />
        </xsd:sequence>
    </xsd:complexType>

    <xsd:complexType name="OpenCmsMyNew">
        <xsd:sequence minOccurs="0" maxOccurs="unbounded">
            <xsd:element name="Title" type="OpenCmsString" />
            <xsd:element name="Image" type="OpenCmsVfsFile"
                minOccurs="0" maxOccurs="1" />
            <xsd:element name="Text" type="OpenCmsHtml"/>
            <xsd:element name="Image" type="OpenCmsVfsFile"
                minOccurs="0" maxOccurs="1" />
        </xsd:sequence>
        <xsd:attribute name="language" type="OpenCmsLocale"
            use="required" />
    </xsd:complexType>

    <xsd:annotation>
        <xsd:appinfo>
            <mappings>
                <mapping element="Title" mapto="property:Title" />
            </mappings>
            <layouts>
                <layout element="Image" widget="ImageGalleryWidget" />
            </layouts>
        </xsd:appinfo>
    </xsd:annotation>
</xsd:schema>

The problem is when I edit news pages, the Editor just show one block
"OpenCmsMyNew" and I can't build an other... If I modify the code in this
way :
<xsd:element name="Text" type="OpenCmsHtml" minOccurs="0"
maxOccurs="unbounded"/>
I'm able to create as many paragraph as i want, but i cant do the same thing
with the "MyNew" block...

Is there somebody to help ?

Anyway, someone could tell me why this is forbidden :
<xsd:complexType name="OpenCmsMyNews">
        <xsd:sequence>
             <xsd:element name="Title" type="OpenCmsString" /> <!-- a main
title and an introduction before displaying news -->
             <xsd:element name="Text" type="OpenCmsHtml"/>
            <xsd:element name="MyNew" type="OpenCmsMyNew"
                minOccurs="0" maxOccurs="unbounded" />
        </xsd:sequence>
    </xsd:complexType>

    <xsd:complexType name="OpenCmsMyNew">
        <xsd:sequence minOccurs="0" maxOccurs="unbounded">
            <xsd:element name="Title" type="OpenCmsString" />
            <xsd:element name="Image" type="OpenCmsVfsFile"
                minOccurs="0" maxOccurs="1" />
            <xsd:element name="Text" type="OpenCmsHtml"/>
            <xsd:element name="Image" type="OpenCmsVfsFile"
                minOccurs="0" maxOccurs="1" />
        </xsd:sequence>
        <xsd:attribute name="language" type="OpenCmsLocale"
            use="required" />
    </xsd:complexType>

thank you all


-- 
TERRITORIO Jordan-Victor
Ingénieur d'Intégration Java
TEAMLOG – Ingenieurs 2000

+33 6 30 66 54 69
jot at teamlog.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://webmail.opencms.org/pipermail/opencms-dev/attachments/20080506/7b6a5a16/attachment.htm>


More information about the opencms-dev mailing list