From: "Simeon H.K. Fitch" <[EMAIL PROTECTED]> > > One thing I'm not clear about (due to my weak XML knowledge). If, for sake > of argument, the build file was parsed *with* a DTD. Is it actually possible > to define a DTD, without namespaces, that allows the same element name to > have two different contexts?
Sort of. An element can appear in two different contexts, but it is the same type of thing in those two contexts. For example in an EJB deployment descriptor the <ejb-home> element can occur in two different contexts. This was actually the source of a bug in ejbjar for a while. What the context cannot changeis the element's "XML behaviour". By XML behaviour, I mean the attributes and subelements it can contain.. Another example is the <property> tag. It can occur in a project or a target. In those two contexts it behaves the same at an XML level, even if it behaves differently at an Ant level. If someone used <project> as a nested element, then it would be legal, according to the DTD, for that element to take a "default" attribute and for it to contain a <target> element. > If the answer is no, then I would recommend > that we at least keep the door open to DTD use in Ant, even though it is not > a requrement. Perhaps some day DTD use will be included by having DTD > snippets included at parse time based on the loaded tasks... > I think <antstructure> is the only way to go here and perhaps it could warn us when it encounters elements which conflict. That was we could at least keep the Ant distribution XML legal. What all this means for Antidote is that it must take context into account, IMHO, since we cannot guarantee that someone's custom task will not break the rules.
