[From nobody Fri Aug 6 17:07:29 2004 >From - Fri Mar 15 14: 50:25 2002 X-Mozilla-Status2: 00000000 Return-Path: <david-b@pacbell.net> Received: from mta5.snfc21.pbi.net (mta5.snfc21.pbi.net [206.13.28.241]) by thor.host4u.net (8.11.6/8.11.6) with ESMTP id g2FK8ir10461 for <dms@sosnoski.com>; Fri, 15 Mar 2002 14:08:44 -0600 Received: from krypton ([206.170.7.91]) by mta5.snfc21.pbi.net (iPlanet Messaging Server 5.1 (built May 7 2001)) with SMTP id <0GT100CRB6GJFF@mta5.snfc21.pbi.net> for dms@sosnoski.com; Fri, 15 Mar 2002 12:05:09 -0800 (PST) Date: Fri, 15 Mar 2002 12:03:31 -0800 From: David Brownell <david-b@pacbell.net> Subject: Re: SAX/SAX2 parser reusability To: Dennis Sosnoski <dms@sosnoski.com> Cc: David Megginson <david@megginson.com> Message-id: <020c01c1cc5c$7b8d4d40$6800000a@brownell.org> MIME-version: 1.0 X-MIMEOLE: Produced By Microsoft MimeOLE V5.50.4133.2400 X-Mailer: Microsoft Outlook Express 5.50.4133.2400 Content-type: text/plain; charset=iso-8859-1 Content-transfer-encoding: 7bit X-Priority: 3 X-MSMail-priority: Normal References: <E16lorW-0004pT-00@usw-sf-web1.sourceforge.net> <15505.59043.661672.183245@megginson.com> <3C924B61.1060803@sosnoski.com> Dennis -- SAX parsers that can't be re-used after they (or some handler they call) throw an exception are nonconformant. Throwing an exception should only abort the current parse. As it says in the javadoc for XMLReader.parse(): Once a parse is complete, an application may reuse the same XMLReader object, possibly with a different input source. ... If a client application wants to terminate parsing early, it should throw an exception. Throwing an exception just causes "early" completion. I'm not sure what javadoc seems to suggest otherwise; could you point it out to me? FWIW, that's the policy I'd expect from instances of any class whatsoever, unless its interface spec said quite explicitly that it self-corrupted when throwing exceptions. - Dave ----- Original Message ----- From: "Dennis Sosnoski" <dms@sosnoski.com> To: "David Brownell" <dbrownell@users.sourceforge.net> Cc: "David Megginson" <david@megginson.com> Sent: Friday, March 15, 2002 11:28 AM Subject: Re: SAX/SAX2 parser reusability > Hi DavidB, > > This is in regard to a current discussion on the JDOM email list, so I'd > like permission to forward your response there. The issue is whether > parser reusability is something that can be depended on. > > Thanks, > > - Dennis > > David Megginson wrote: > > >Dennis Sosnoski writes: > > > > > I can see where the documentation might be subject to > > > different interpretations - the error handling code says the > > > parser can basically die after throwing a fatal exception. > > > My own interpretation is that the parser can die *for that > > > document only*, and must still be usable with other > > > documents on later calls to parse. > > > >That was my intention as well -- that the parser should be reusable > >for a new parse. I've copied the current SAX maintainer, David > >Brownell, so that he can decide whether any documentation > >clarifications are in order. > > > > > >All the best, > > > > > >David > > > > ]