Return-Path: Delivered-To: apmail-xml-xalan-c-users-archive@xml.apache.org Received: (qmail 97077 invoked by uid 500); 30 Jul 2002 21:24:05 -0000 Mailing-List: contact xalan-c-users-help@xml.apache.org; run by ezmlm Precedence: bulk list-help: list-unsubscribe: list-post: Delivered-To: mailing list xalan-c-users@xml.apache.org Received: (qmail 97039 invoked from network); 30 Jul 2002 21:24:04 -0000 Received: from lotus2.lotus.com (129.42.248.42) by daedalus.apache.org with SMTP; 30 Jul 2002 21:24:04 -0000 Received: from internet2.lotus.com (internet2 [172.16.131.236]) by lotus2.lotus.com (8.12.3/8.12.1) with ESMTP id g6ULQHJB017989 for ; Tue, 30 Jul 2002 17:26:17 -0400 (EDT) Received: from a3mail.lotus.com (a3mail.lotus.com [9.33.9.65]) by internet2.lotus.com (8.12.3/8.12.1) with ESMTP id g6ULOAM6023431 for ; Tue, 30 Jul 2002 17:24:10 -0400 (EDT) Subject: Re: How to use DocumentBuilder? To: "'xalan-c-users@xml.apache.org'" X-Mailer: Lotus Notes Release 5.0.6a January 17, 2001 Message-ID: From: David N Bertoni/Cambridge/IBM Date: Tue, 30 Jul 2002 14:25:09 -0700 X-MIMETrack: Serialize by Router on A3MAIL/CAM/H/Lotus(Build V60_M14_07162002NP Release Candidate|July 16, 2002) at 07/30/2002 05:24:13 PM MIME-Version: 1.0 Content-type: text/plain; charset=US-ASCII X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N Status: O X-Status: X-Keywords: X-UID: 69 Yes, XalanDocumentBuilder _only_ supports building a document through SAX2 calls. That's the only way you can use Xalan's internal source tree implementation, which is what XalanDocumentBuilder uses for its implementation. If you really must use DOM calls, you can use the Xerces DOM interfaces, then follow this usage pattern to do a transformation: http://xml.apache.org/xalan-c/usagepatterns. html#xercesdomwrapperparsedsource However, be prepared for longer transformation times and greater memory usage. Dave "Xiao, Ke" tegy.com> cc: (bcc: David N Bertoni/Cambridge/IBM) Subject: How to use DocumentBuilder? 07/30/2002 02:07 PM Hi,all I want to use DocumentBuilder to create a Xalan Document for transform, but it always fails. My code is like: XalanTransformer theXalanTransformer; // Get a document builder from the transformer... XalanDocumentBuilder* const theBuilder = theXalanTransformer. createDocumentBuilder(); XalanDocument *lpDoc = theBuilder->getDocument(); When I try to use lpDoc to create any XalanElement or other nodes, it always fails. I debug the code and find that the lpDoc is a XalanSourceTreeDocument class, all creatXXX methods in that class are not supported and throw an exception. There is a DocumentBuilder sample in Xalan, but it use SAX2 ContentHandler from the DocumentBuilder to create the document. Does this mean that DocumentBuilder only support SAX2 content handler , but do not support any DOM here? Do I have any other ways to solve this? Thanks a lot,