Not to split hairs, but if I provide the stream, and am responsible to close the stream, does that mean that Xerces requires the stream to be open already? Again, not to get to picky here, but I suppose the thing I am getting at is the issue of what part of the app is responsible for stream/file management. Is it the parser's, or the calling app? I am just interested in a level of consistency -- if the parser is strictly "hands off" as far as stream/file management goes, then I would guess the parser would require that the stream be open already, and upon exit, the parser does not close the stream/file. Or, if the parser is "hands on" as far as stream/file management goes, then I would guess the parser would open the stream for us, and then close it upon exit, returning it to the state it was when the parse method was called.
Perhaps I can simplify this thread down to two issues: 1) Is it important to have an InputSource handled in the same manner as a uri as far as the parse() method is concerned? 2) Is it a generally recognized standard that postconditions in methods be consistent (i.e. resources are left in a consistent state regardless of whether the method throws an Exception or returns cleanly) and methods are "good citizens" in the respect that they return resources to the state that they were prior to the method call? Again, I hate to sound picky, but a seemingly small compromise on #2 is one of those things that over time can lead to a whole list of caveats (and associated needed documentation) due to the introduction of new app state upon return from a method (case and point, the example in this thread). Anyway, just trying to help out. BradO -----Original Message----- From: Andy Clark [mailto:[EMAIL PROTECTED] Sent: Wednesday, March 07, 2001 2:22 PM To: [EMAIL PROTECTED] Subject: Re: Explicit file closing Brad O'Hearne wrote: > Is this the proper behavior? The second situation is the one that I am in. > If this is the accepted behavior, then I will just close the InputSource > myself. If you provide the stream, you should close it. We've had people in the past that needed the stream to remain open so we don't touch it if you opened it. -- Andy Clark * IBM, TRL - Japan * [EMAIL PROTECTED] --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
