I am by no means an expert, but, IIRC, SAX and DOM are substantially different.
> Sure... What I was saying was that I find strange that Ant complains about a > semantic error (<javadoc> not supporting the <patternset> element) when it's > a syntactic error (closing tag without a opening tag), i.e. the document is > not well formed XML. > > I don't know about SAX, but I do believe trying to load that XML build file > in the DOM would have resulted in some kind of parser exception. --DD DOM parsers suck the whole document into memory and parse it completely (or behave as if they do), before they return to the caller. SAX, on the other hand, parses the document sequentially, more like sed. With DOM, your program doesn't get a chance to start looking at the semantics if the document is well-formed, but with SAX, there may be certain aspects of well-formedness that would not be visible before Ant starts checking semantics. In fact, this is one of the specific cases where you would be likely to register some semantic error before the parser discovers that it's got a terminating tag it doesn't know what to do with. Incidentally, although there is no explicit DTD, the fact that Ant detects the false nesting underscores that there is some implicit document type defined by the program flow in Ant. > -----Original Message----- > From: Diane Holt [mailto:[EMAIL PROTECTED]] > Sent: Wednesday, July 24, 2002 3:34 PM > To: Ant Users List > Subject: RE: The <javadoc> task doesn't support the nested "patternset" el > ement > > --- Dominique Devienne <[EMAIL PROTECTED]> wrote: > > Actually, I believe Ronald is right: > > > > <fileset dir="${dir.src}" /> > > <patternset refid="patternset.src" /> > > </fileset> > > > > There's indeed nothing wrong with the first <fileset />, neither with > > the <patternset/> on line 2 above, but </fileset> on line 3 is > > incorrect (it doesn't close any opening <fileset>). > > > > My limited understanding of XML would tell me this is indeed not well > > formed XML... As to how this is not detected by Ant/SAX1, I'll leave > > that to the experts. > > Well, I'm not the person to address that last bit, since I'm not even > close to an XML or SAX1 expert -- but my point was that the error message > did provide the information he needed. Here, from the original posting, is > where the problem was: > > What is wrong with this file? According to the Ant 1.5 > > documentation, a patternset can be nested within > > a fileset. And the javadoc task does support filesets > > He didn't read the error message correctly. The message did not say that > <fileset> doesn't support the nested "patternset" element -- it said that > <javadoc> doesn't. And if he had read the message correctly, he'd have > most likely caught the mistake that was causing <patternset> to be seen as > a nested element of <javadoc> instead of as one of the <fileset> as he'd > intended, since he would have been trying to discover why it thought the > <patternset> was a nested element of <javadoc> when clearly he'd put it > under <fileset .../> -- oops, <fileset ../>, a-ha! > > Diane > > > ===== > ([EMAIL PROTECTED]) -- Joel Rees <[EMAIL PROTECTED]> -- To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]> For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>