You are viewing a plain text version of this content. The canonical link for it is here.
Posted to jaxme-dev@ws.apache.org by shobha <sh...@gmail.com> on 2007/10/08 08:57:54 UTC

Error message while generating java classes : Model groups with maxOccurs > 1 are not yet supported.

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: jaxme-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: jaxme-dev-help@ws.apache.org


Re: Error message while generating java classes : Model groups with maxOccurs > 1 are not yet supported.

Posted by shobha <sh...@gmail.com>.
Hi Jose,
Thanks for the help
but i cant change the xml b'coz its request i mean i am getting this
request.xml file as request and i want to process the request.The request is
auto generated xml file.
is there any another way?????

Regards,
Shobha


Jose Luis Huertas Fernández wrote:
> 
> 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 <sh...@gmail.com>:
>>
>>
>> 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: jaxme-dev-unsubscribe@ws.apache.org
>> For additional commands, e-mail: jaxme-dev-help@ws.apache.org
>>
>>
> 
> 

-- 
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#a13093145
Sent from the JaxMe - Dev mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: jaxme-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: jaxme-dev-help@ws.apache.org


Re: Error message while generating java classes : Model groups with maxOccurs > 1 are not yet supported.

Posted by Jose Luis Huertas Fernández <jo...@gmail.com>.
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 <sh...@gmail.com>:
>
>
> 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: jaxme-dev-unsubscribe@ws.apache.org
> For additional commands, e-mail: jaxme-dev-help@ws.apache.org
>
>