Altova Mailing List Archives>Archive Index >comp.text.xml Archive Home >Recent entries [Thread Prev] >Thread Next - Re: [DTD] defining elements depending on attribute [DTD] defining elements depending on attributeTo: NULL Date: 12/1/2004 9:57:00 PM hello, I wanna create a new DTD for a protocol - therefore I have one question: is there a way to define elements depending on a special attribute-value? I guess I've confused you so far, so that's what I really mean: I have got an element "sensor": <!ELEMENT sensor ((longitude, latitude) | (direction, speed))> This element has an attribute "type": <!ATTLIST sensor type (GPS | WIND) "GPS"> My question now is, if it is possible that the sub-elements of "sensor" are "longitude, latitude" only in the case when the type-attribute = "GPS". When the type-attribute = "WIND", the sub-elements shall exactly be "direction, speed". Currently it doesn't matter which value the type-attribute actually has - the subelements can either be (longitude, latitude) OR (direction, speed). But I want them only when the attribute is set accordingly. Do you have an idea how to do that? Is there a way in DTD to specify such things? I appreciate any help, ekim | ||||||
| Company | Legal | Press | Partners | Careers | Sitemap | Contact Us | Altova Blog | Mobile | Full Site | |||
|
