You are viewing a plain text version of this content. The canonical link for it is here.
Posted to j-users@xerces.apache.org by Rob Outar <ro...@ideorlando.org> on 2003/08/12 17:15:01 UTC
XMLReader not releasing file reference
Hi all,
I have an application that only needs to read preprocessing instructions
from an XML file. Since I am only interested in Processing Instructions
when I encounter the start element I throw a SAX Exception to abort parsing:
public void startElement(String uri, String localName, String qName,
Attributes attributes) throws SAXException {
throw new SAXException("Abort Parsing");
Once this exception is encountered by the client application I then try to
delete the XML file, some of the XML files I read can be deleted while
others cannot. The problem seems to occur on large files ( > 200kb )....
Is there any reason the XMLReader would maintain the file reference? I am
not sure what is happening as I mentioned usually all of the smaller files
are deleted just fine but larger ones seem to have a file reference and
File.delete() fails (return false).
Any help would be appreciated.
Thanks,
Rob
---------------------------------------------------------------------
To unsubscribe, e-mail: xerces-j-user-unsubscribe@xml.apache.org
For additional commands, e-mail: xerces-j-user-help@xml.apache.org
RE: XMLReader not releasing file reference
Posted by Rob Outar <ro...@ideorlando.org>.
Update:
Tried a 20kb file and the same problem. Seems like whenever a SAXException
is thrown the Xerces SAXParser does not release the reference to the file.
We saw when the files were tiny, 5kb or so those seem to be okay.
Thanks,
Rob
-----Original Message-----
From: Rob Outar [mailto:routar@ideorlando.org]
Sent: Tuesday, August 12, 2003 11:15 AM
To: xerces-j-user@xml.apache.org
Subject: XMLReader not releasing file reference
Hi all,
I have an application that only needs to read preprocessing instructions
from an XML file. Since I am only interested in Processing Instructions
when I encounter the start element I throw a SAX Exception to abort parsing:
public void startElement(String uri, String localName, String qName,
Attributes attributes) throws SAXException {
throw new SAXException("Abort Parsing");
Once this exception is encountered by the client application I then try to
delete the XML file, some of the XML files I read can be deleted while
others cannot. The problem seems to occur on large files ( > 200kb )....
Is there any reason the XMLReader would maintain the file reference? I am
not sure what is happening as I mentioned usually all of the smaller files
are deleted just fine but larger ones seem to have a file reference and
File.delete() fails (return false).
Any help would be appreciated.
Thanks,
Rob
---------------------------------------------------------------------
To unsubscribe, e-mail: xerces-j-user-unsubscribe@xml.apache.org
For additional commands, e-mail: xerces-j-user-help@xml.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: xerces-j-user-unsubscribe@xml.apache.org
For additional commands, e-mail: xerces-j-user-help@xml.apache.org