Re: Schema definition
Michael Glavassevich <[email protected]> Thu, 7 Jun 2007 15:39:23 -0400
| Newsgroups | gmane.text.xml.general |
|---|---|
| Message-ID | <OF2DC8F5B6.94302053-ON852572F3.006A4C35-852572F3.006BFBAD@ca.ibm.com> |
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]