From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: "Andrew W. Nosenko" Newsgroups: gmane.emacs.devel Subject: Re: Linking Emacs with libxml2 Date: Fri, 10 Sep 2010 17:12:02 +0300 Message-ID: References: <8A20526E-44B3-4434-9D40-54A36F976CD6@mit.edu> <4C85892B.5080105@gnu.org> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-Trace: dough.gmane.org 1284127998 20504 80.91.229.12 (10 Sep 2010 14:13:18 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Fri, 10 Sep 2010 14:13:18 +0000 (UTC) Cc: Andreas Schwab , emacs-devel@gnu.org To: Stefan Monnier Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Fri Sep 10 16:13:12 2010 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1Ou4Li-0002fN-Nj for ged-emacs-devel@m.gmane.org; Fri, 10 Sep 2010 16:13:07 +0200 Original-Received: from localhost ([127.0.0.1]:46838 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Ou4Li-00075B-38 for ged-emacs-devel@m.gmane.org; Fri, 10 Sep 2010 10:13:06 -0400 Original-Received: from [140.186.70.92] (port=46349 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Ou4Kj-0006Oi-L9 for emacs-devel@gnu.org; Fri, 10 Sep 2010 10:12:07 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1Ou4Kh-00039P-RG for emacs-devel@gnu.org; Fri, 10 Sep 2010 10:12:05 -0400 Original-Received: from mail-qw0-f41.google.com ([209.85.216.41]:42709) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1Ou4Kh-00039C-Ou for emacs-devel@gnu.org; Fri, 10 Sep 2010 10:12:03 -0400 Original-Received: by qwf7 with SMTP id 7so1259271qwf.0 for ; Fri, 10 Sep 2010 07:12:03 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:received:in-reply-to :references:date:message-id:subject:from:to:cc:content-type :content-transfer-encoding; bh=NTfAG107xHALysF/ahWxb8KRtOEg3bkp4r4+v/hce5I=; b=HssmHpOjyAgbdgIWTUhNRPoFKBPZQ4xxng7aB4YLkIVJlOYV3lBATAbznMj7hB7TG9 tOpFjfqIGiVRYksaTzbjsxk7E4ZtmofGPxmX7WA7uK2JpSokFzkEpTGR520iChEP23Rs HTZkFJP8bwdwaS3tr0XZmfdd2CVW8CbwK4Te0= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type:content-transfer-encoding; b=p4E69m0jePmGM+qDoUtYS2u4Oa7b263a0KcEAC58ytAP4DxpQWsfof/TFxWLJd57Eg MWjm881k25U9/U5KIPAiHeaxy+s0n9s11MFBfwMdQb1FRQWNQq38qTCjB3ucwKop3kUD Gd1SDoIq3ZrbZ7tPdKHkxAX+zlnZOSNSn479Y= Original-Received: by 10.224.80.133 with SMTP id t5mr419907qak.75.1284127922609; Fri, 10 Sep 2010 07:12:02 -0700 (PDT) Original-Received: by 10.229.1.93 with HTTP; Fri, 10 Sep 2010 07:12:02 -0700 (PDT) In-Reply-To: X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2) X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:129904 Archived-At: On Fri, Sep 10, 2010 at 13:46, Stefan Monnier wr= ote: >>> Hm. =A0I guess so. =A0I'll change the html-parse-buffer function into a >>> html-parse-string function instead. >> I think it is still useful to provide a html-parse-buffer function that >> can be more efficient when the intermediate string copy is not needed. > > Agreed, but right now it's not clear when/how such an intermediate copy > can be avoided. Try the xml*IO family of functions. E.g. instead of xmlReadDoc() try xmlReadIO(). Indeed, the libxml2 doesn't need the whole document in memory for parse it. IO callbacks supply as mech as need data when it requested by underlying parser. > > BTW, another question regarding libxml2: does it provide functions to do > partial parses (e.g. to know the syntactic context of a particular > buffer position)? > > > =A0 =A0 =A0 =A0Stefan > > --=20 Andrew W. Nosenko