Altova Mailing List Archives>Archive Index >comp.text.xml Archive Home >Recent entries >Thread Prev - DTD design practices [Thread Next] Re: DTD design practicesTo: NULL Date: 4/1/2006 1:54:00 AM Thank you for the helpful replies to my questions. Girish Sharma "Girish Sharma" <remvgirish.sharma@e...> wrote in message news:2ooUf.5961$x94.4248@n...... > I'm new to using XML. I am currently required to use dtd's rather than > schemas. I have some questions about what is considered appropriate design > with a dtd. It seems that none of the following are enforced by the dtd > during a standard validation: > > 1. Using the value of attributes to constrain which of the optional child > elements are allowed to be used. > > 2. Restricting the number of a particular element that can exist with a > particular attribute value. > > 3. Restricting which of some optional child elements are allowed based on > the context (the grand-parent element) of the parent element. > > Is creating a dtd that uses these concepts, even though they are not > enforced during standard validation, considered less than optimal design? > > Are there commonly used alternatives to the above that do allow for dtd > enforcement? > > I'm wondering for example for number 1, instead of attribute values using > optional child elements that correspond with each of those values. Then > each of those child elements can in turn can have the desired child > elements for that situation. It could result in a large number of the > "intermediate" child elements if there are many possible attribute values. > > For number 2, is there any way to accomplish that using child elements > instead of attribute values? > > For number 3, it seems that changing the parent element into several > similar elements and then using the appropriate one in the correct > context. If carried to an extreme though, there would be no optional child > elements at all - only different parent elements. But my question relates > specifically about always being required to use particular optional child > elements based on context. > > Thank you. > > Girish Sharma > | ||||||
| Company | Legal | Press | Partners | Careers | Sitemap | Contact Us | Altova Blog | Mobile | Full Site | |||
|
