Return-Path: Mailing-List: contact general-help@xml.apache.org; run by ezmlm Delivered-To: mailing list general@xml.apache.org Received: (qmail 14865 invoked from network); 30 Nov 2000 16:28:54 -0000 Received: from hrz-wstest6.hrz.uni-kassel.de (HELO hrz-wstest6.uni-kassel.de) (141.51.8.15) by locus.apache.org with SMTP; 30 Nov 2000 16:28:54 -0000 Received: from ibiza (morad@ibiza.db.informatik.uni-kassel.de [141.51.180.25]) by hrz-wstest6.uni-kassel.de (8.10.1/8.10.1) with SMTP id eAUGUZE03422 for ; Thu, 30 Nov 2000 17:30:35 +0100 (MET) From: Ahmad Morad Organization: Gh Kassel To: general@xml.apache.org Subject: DocumentBuilder.parse() Date: Thu, 30 Nov 2000 17:28:50 +0100 X-Mailer: KMail [version 1.1.90] Content-Type: text/plain MIME-Version: 1.0 Message-Id: <00113017285005.32292@ibiza> Content-Transfer-Encoding: 8bit X-Spam-Rating: locus.apache.org 1.6.2 0/1000/N Hello, With the following code I read an XML-Document from an �InputSource� and store it in a �Document� object using the DocumentBuilder.parse() method. However the InputSource is the InputStream of a socket. the parse method close the stream after reading the document! This well close the connection to the server ! The only way I know to avoid that is to read the document in a string and to call the parse method to read the string in a dom tree. But this sulution is very slow! how can I avoid the parser from closing the stream after the parse process has been finished ? Than you Morad Ahmad code : -- DocumentBuilderFactory dfactory = DocumentBuilderFactory.newInstance(); DocumentBuilder docBuilder = dfactory.newDocumentBuilder(); Document doc = docBuilder.parse(from); // after that from well be closed return doc; --