Vipin,

The only attribute in XML Schema 1.0 that can be used to do what you want 
is xsi:type.

FYI: The W3C mailing list [1] is a more appropriate list for generic 
queries such as this.

Thanks.

[1] http://lists.w3.org/Archives/Public/xmlschema-dev/

Michael Glavassevich
XML Parser Development
IBM Toronto Lab
E-mail: [EMAIL PROTECTED]
E-mail: [EMAIL PROTECTED]

vipin <[EMAIL PROTECTED]> wrote on 06/07/2007 02:57:41 PM:

> Hi,
> 
> I have a generic question regarding writing xsd for XML.
> 
> Is it possible to write a schema(xsd) if children of an element depends 
on
> value of a particular attribute ?
> 
> for eg, if type="service" then children of  will be 
> (protocal,srcport,destport,icmpType,icmpCode)            AND
>           if type="device" then children of  will be 
(ip,hostname,domain) 
> 
>            <Service>
> 
>                    <protocol/>
>                    <srcPort/>
>                    <destPort/>
>                    <icmpType/>
>                    <icmpCode/>
> 
>             <Service>
> 
>             <ReportingDevices>
> 
>                     <ip/>
>                     <hostName/>
>                     <domain/>
> 
>             </ReportingDevices>
> 
> Thanks,
> Vipin V S.
> -- 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED] 


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to