Whilst the XML schema fragment given by you does not really express that
exclusive or relationship, I think that it should serve your needs
(until somebody else offers a more sophisticated approach).

Having said that, Castor should not complain about this scenario. Can I
please ask you to create a new Jira issue at

http://jira.codehaus.org/browse/CASTOR

and attach all relevant files. If you followed the guidelines available
in the XML HOW-TO section, that would be even greater.

Thanks
Werner

Sameer Singh wrote:
> I have the following two XML Snippets =>
> 
>  
> 
> Snippet 1 =>
> 
>  
> 
> <query name="Q1" datasource="SomeDS">
>  <description>
> Some Description
>  </description>
>  <statement>
>      <filter>
>       (&amp;(objectclass=group)(cn=#P1#))
>      </filter>
>      <attributes>
>       name,managedBy,description
>      </attributes>
>  </statement>
>      <map name="M2">
>   <entry Field="EUIT_GLB_GRP_INFO.GROUP_NAME" Column="name"/>
>   <entry Field="EUIT_GLB_GRP_INFO.GROUP_DESCRIPTION" Column="description"/>
>   <entry Field="EUIT_GLB_GRP_INFO.OWNER" Column="managedBy"/>
>      </map>
>  </query>
> 
>  
> 
>  
> 
>  
> 
> Snippet 2 =>
> 
>  
> 
> <query name="Q1" datasource="SomeDS">
>  <description>
> Some Description
>  </description>
>  <statement>
> Select * from SomeTable
>  </statement>
>      <map name="M2">
>   <entry Field="EUIT_GLB_GRP_INFO.GROUP_NAME" Column="name"/>
>   <entry Field="EUIT_GLB_GRP_INFO.GROUP_DESCRIPTION" Column="description"/>
>   <entry Field="EUIT_GLB_GRP_INFO.OWNER" Column="managedBy"/>
>      </map>
>  </query>
> 
>  
> 
>  If you look at the statement node it can either contain some text or
> contain two other elements filter and attributes. How can I represent
> this in xsd?
> 
>  
> 
> I used the following:
> 
>  
> 
> <xs:element name="statement">
>       <xs:complexType mixed="true">
>        <xs:sequence minOccurs="0">
>         <xs:element ref="filter" minOccurs="0"/>
>         <xs:element ref="attributes" minOccurs="0"/>
>        </xs:sequence>
>       </xs:complexType>
>     </xs:element>
> 
>  
> 
> however, when i use Castor to unmarshal data, I get an error saying  =>
>  
> Illegal Text data found as child of: statement (for Snippet 2) 
> 
> Any ideas anyone?
> 
>  
> 
> Thanks
> 
> 
> Sameer
> 
>  
> 


---------------------------------------------------------------------
To unsubscribe from this list please visit:

    http://xircles.codehaus.org/manage_email

Reply via email to