Hi Shobba, I'm afraid you will have to use a workaround until this feature
is implemented :(

This could be a possible solution. It's a bit ugly because it introduces a
new "artificial" element ("directoryelement") which can be a "directory" or
a "file", but it works:

<?xml version="1.0" encoding="utf-8"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema";
  elementFormDefault="qualified" attributeFormDefault="unqualified">
  <xs:element name="directory">
    <xs:complexType>
      <xs:sequence>
        <xs:element name="directoryelement" minOccurs="0"
maxOccurs="unbounded">
          <xs:complexType>
            <xs:choice>
              <xs:element ref="directory"/>
              <xs:element name="file">
                <xs:complexType>
                  <xs:attribute name="name" type="xs:string"/>
                </xs:complexType>
              </xs:element>
            </xs:choice>
          </xs:complexType>
        </xs:element>
      </xs:sequence>
      <xs:attribute name="content" type="xs:string" default="all"/>
      <xs:attribute name="type" type="xs:string"/>
      <xs:attribute name="path" type="xs:string"/>
    </xs:complexType>
  </xs:element>
</xs:schema>

Now you can validate XML like this:

<?xml version="1.0" encoding="utf-8"?>
<directory xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";
xsi:noNamespaceSchemaLocation="file:///D:/temp/directory.xsd" content="all"
type="local" path="C:\Examples\StoryBoarding">
  <directoryelement>
    <directory content="all" type="local"
path="C:\Examples\StoryBoarding\NewFolder">
      <directoryelement>
        <file name="C:\Examples\StoryBoarding\NewFolder\shobha.txt"/>
      </directoryelement>
    </directory>
  </directoryelement>
  <directoryelement>
    <file name="C:\Examples\StoryBoarding\test1.xml"/>
  </directoryelement>
</directory>

or this (different order):

<?xml version="1.0" encoding="utf-8"?>
<directory xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";
xsi:noNamespaceSchemaLocation="file:///D:/temp/directory.xsd" content="all"
type="local" path="C:\Examples\StoryBoarding">
  <directoryelement>
    <file name="C:\Examples\StoryBoarding\test1.xml"/>
  </directoryelement>
  <directoryelement>
    <directory content="all" type="local"
path="C:\Examples\StoryBoarding\NewFolder">
      <directoryelement>
        <file name="C:\Examples\StoryBoarding\NewFolder\shobha.txt"/>
      </directoryelement>
    </directory>
  </directoryelement>
</directory>

Hope this helps,

Jose Luis.

2007/10/8, shobha <[EMAIL PROTECTED]>:
>
>
> Hi,
> i am new to jaxMe and trying to generate java classes uusing attached
> xsd.But while generating java classes i am getting following  error :
> Build Failed: Model groups with maxOccurs > 1 are not yet supported.
> the xsd is
> <xs:group name="Directory">
>     <xs:sequence>
>         <xs:element name="Directory" minOccurs="0" maxOccurs="unbounded">
>                 <xs:complexType>
>                          <xs:group ref="Directory" minOccurs="0"
> maxOccurs="unbounded" />
>                                 <xs:attribute name="content"
> type="xs:string" default="all"/>
>                                 <xs:attribute name="path"
> type="xs:string"/>
>                 </xs:complexType>
>           <xs:element name="File" minOccurs="0" maxOccurs="unbounded">
>                  <xs:complexType>
>                            <xs:attribute name="Name" type="xs:string"/>
>                    </xs:complexType>
>             </xs:element>
> </xs:sequence>
> </xs:group>
>
> for the follwoing xml:
>
>         <Directory content="all" type="local"
> path="C:\Examples\StoryBoarding">
>                 <file path="C:\Examples\StoryBoarding\test1.xml"/>
>                 <Directory content="all" type="local"
> path="C:\Examples\StoryBoarding\NewFolder">
>                     <file
> path="C:\Examples\StoryBoarding\NewFolder\shobha.txt"/>
>                 </Directory>
>         </Directory>
> i tried using complex type but in complex type the order of occurrence  of
> directory and file matters.means diretory inside  directory should come
> after file.but i dont want any dependancies.
> i wud be very thankfull if someone could  tell me the solution
> thank in advance.
>
> Regards,
>
> Shobha
> --
> View this message in context:
> http://www.nabble.com/Error-message-while-generating-java-classes-%3A-Model-groups-with-maxOccurs-%3E-1-are-not-yet-supported.-tf4586287.html#a13091520
> Sent from the JaxMe - Dev mailing list archive at Nabble.com.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>

Reply via email to