xml-general mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Michael Glavassevich <mrgla...@ca.ibm.com>
Subject Re: Schema definition
Date Thu, 07 Jun 2007 19:39:23 GMT
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: mrglavas@ca.ibm.com
E-mail: mrglavas@apache.org

vipin <vipinvs@rediffmail.com> 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: general-unsubscribe@xml.apache.org
> For additional commands, e-mail: general-help@xml.apache.org 


---------------------------------------------------------------------
To unsubscribe, e-mail: general-unsubscribe@xml.apache.org
For additional commands, e-mail: general-help@xml.apache.org


Mime
View raw message