From Stan@Tomlinson.com Wed Apr 11 18:16:08 2012 Return-Path: X-Original-To: libxmlplusplus-list@gnome.org Delivered-To: libxmlplusplus-list@gnome.org Received: from localhost (localhost.localdomain [127.0.0.1]) by menubar.gnome.org (Postfix) with ESMTP id 8E6067500BA for ; Wed, 11 Apr 2012 18:16:08 +0000 (UTC) X-Virus-Scanned: by amavisd-new at gnome.org X-Spam-Flag: NO X-Spam-Score: 0.801 X-Spam-Level: X-Spam-Status: No, score=0.801 tagged_above=-999 required=2 tests=[BAYES_50=0.8, HTML_MESSAGE=0.001] autolearn=ham Received: from menubar.gnome.org ([127.0.0.1]) by localhost (menubar.gnome.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id b05+YayfLMEe for ; Wed, 11 Apr 2012 18:15:51 +0000 (UTC) X-Greylist: delayed 576 seconds by postgrey-1.32 at menubar.gnome.org; Wed, 11 Apr 2012 18:15:51 UTC Received: from gonzo.everybyte.com (static-71-165-151-120.lsanca.fios.verizon.net [71.165.151.120]) by menubar.gnome.org (Postfix) with ESMTP id 8345E7500AE for ; Wed, 11 Apr 2012 18:15:43 +0000 (UTC) Received: from gonzo.everybyte.com ([10.1.1.2]) by gonzo.everybyte.com with Microsoft SMTPSVC(6.0.3790.4675); Wed, 11 Apr 2012 11:06:10 -0700 Received: from StanLaptop2010 ([69.234.177.77]) by gonzo.everybyte.com with Microsoft SMTPSVC(6.0.3790.4675); Wed, 11 Apr 2012 11:06:09 -0700 From: "Stan Tomlinson" To: Subject: Changing Node Values for Dereference function Date: Wed, 11 Apr 2012 11:06:08 -0700 Message-ID: MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_NextPart_000_00AF_01CD17D3.192CFF10" X-Mailer: Microsoft Outlook 14.0 thread-index: Ac0YDbipCGRBc6ykQ/K9A+eDahJKMQ== Content-Language: en-us X-OriginalArrivalTime: 11 Apr 2012 18:06:09.0750 (UTC) FILETIME=[C5E6EF60:01CD180D] X-BeenThere: libxmlplusplus-list@gnome.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: libxml++ mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 11 Apr 2012 18:16:08 -0000 This is a multipart message in MIME format. ------=_NextPart_000_00AF_01CD17D3.192CFF10 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit I'm trying to dereference an XML document (i.e., copy referenced nodes and replace the referencer), as in: FROM data data data asdf asdf asdf TO data data data asdf asdf asdf asdf asdf asdf data data data If I make a copy (using create_root_node_by_import), cannot simply update lower nodes with node::import_node, because it doesn't overwrite and simply tacks the new node to end of the node-list, potentially destroying order. Only way I see to do this is to individually and completely copy each node (without using the built-in recursive). Is there a simpler way? (Constraint: I need control of which nodes are actually dereferenced, so a general program is probably not suitable.) Stan ------=_NextPart_000_00AF_01CD17D3.192CFF10 Content-Type: text/html; charset="us-ascii" Content-Transfer-Encoding: quoted-printable

I’m = trying to dereference an XML document (i.e., copy referenced nodes and = replace the referencer), as in:

 

FROM

 

<top>

  <member> data data data = </member>

  = <member> asdf asdf = asdf</member>

  = <other>

   = <member = reference=3D”/top/member[2]”/>

    <member = reference=3D”/top/member”/>

   = </other>

</top>

 

TO

 

<top>

  <member> data data data = </member>

  = <member> asdf asdf = asdf</member>

  = <other>

  =   <member> asdf asdf = asdf</member>

    <member> data data = data </member>

   = </other>

</top>

 

If I make a copy (using = create_root_node_by_import), cannot simply update lower nodes with = node::import_node, because it doesn’t overwrite  and simply = tacks the new node to end of the node-list, potentially destroying = order.

 

Only way I see to do this is to individually = and completely copy each node (without using the built-in = recursive).  Is there a simpler way?

 

(Constraint: I need control of which nodes = are actually dereferenced, so a general program is probably not = suitable.)

 

Stan

= ------=_NextPart_000_00AF_01CD17D3.192CFF10-- From kjell.ahlstedt@bredband.net Thu Apr 12 07:28:26 2012 Return-Path: X-Original-To: libxmlplusplus-list@gnome.org Delivered-To: libxmlplusplus-list@gnome.org Received: from localhost (localhost.localdomain [127.0.0.1]) by menubar.gnome.org (Postfix) with ESMTP id A59AC7501FD for ; Thu, 12 Apr 2012 07:28:26 +0000 (UTC) X-Virus-Scanned: by amavisd-new at gnome.org X-Spam-Flag: NO X-Spam-Score: -1.9 X-Spam-Level: X-Spam-Status: No, score=-1.9 tagged_above=-999 required=2 tests=[BAYES_00=-1.9, RCVD_IN_DNSWL_NONE=-0.0001, SPF_PASS=-0.001, SUBJ_OBFU_PUNCT_FEW=0.001] autolearn=ham Received: from menubar.gnome.org ([127.0.0.1]) by localhost (menubar.gnome.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id DB5Jb9qoNVOf for ; Thu, 12 Apr 2012 07:28:19 +0000 (UTC) Received: from smtprelay-b12.telenor.se (smtprelay-b12.telenor.se [62.127.194.21]) by menubar.gnome.org (Postfix) with ESMTP id 704E0750393 for ; Thu, 12 Apr 2012 07:28:10 +0000 (UTC) Received: from ipb1.telenor.se (ipb1.telenor.se [195.54.127.164]) by smtprelay-b12.telenor.se (Postfix) with ESMTP id 99A3CDE17 for ; Thu, 12 Apr 2012 09:27:53 +0200 (CEST) X-SMTPAUTH-B2: [kjelahls] X-SENDER-IP: [85.227.232.137] X-LISTENER: [smtp.bredband.net] X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: Ak8lAMGChk9V4+iJPGdsb2JhbAANN4oor1QBAQEBN4J8QD0WGAMCAQIBMScIAQHCbY5VgyQEln2IRYlJ X-IronPort-AV: E=Sophos;i="4.75,410,1330902000"; d="scan'208";a="310730312" Received: from c-89e8e355.06-203-73746f44.cust.bredbandsbolaget.se (HELO [192.168.1.64]) ([85.227.232.137]) by ipb1.telenor.se with ESMTP; 12 Apr 2012 09:27:53 +0200 Message-ID: <4F8683F8.5090507@bredband.net> Date: Thu, 12 Apr 2012 09:27:52 +0200 From: Kjell Ahlstedt User-Agent: Mozilla/5.0 (X11; Linux i686; rv:11.0) Gecko/20120329 Thunderbird/11.0.1 MIME-Version: 1.0 To: libxmlplusplus-list@gnome.org Subject: Shouldn't LIBXMLCPP_EXCEPTIONS_ENABLED be defined? Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-BeenThere: libxmlplusplus-list@gnome.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: libxml++ mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 12 Apr 2012 07:28:26 -0000 After the --disable-api-exceptions configure option was removed (commit 81fead80bc5d0cc6f6188fd2d0f883def0e9a01e), LIBXMLCPP_EXCEPTIONS_ENABLED is not defined in libxml++/config.h. Application programs that contain code such as #ifdef LIBXMLCPP_EXCEPTIONS_ENABLED try { #endif //LIBXMLCPP_EXCEPTIONS_ENABLED ......... ......... #ifdef LIBXMLCPP_EXCEPTIONS_ENABLED } catch (const xmlpp::exception& ex) { std::cout << "Exception caught: " << ex.what() << std::endl; } #endif //LIBXMLCPP_EXCEPTIONS_ENABLED will not catch exceptions. Compare e.g. glibmm. glibmm/configure.ac contains AC_DEFINE([GLIBMM_EXCEPTIONS_ENABLED],[1], [This is always set. This is only for backwards compatibility.]) and GLIBMM_EXCEPTIONS_ENABLED is defined in glibmm/config.h. Shouldn't libxml++/configure.ac contain AC_DEFINE([LIBXMLCPP_EXCEPTIONS_ENABLED],[1], [This is always set. This is only for backwards compatibility.]) until the next API break? From murrayc@murrayc.com Thu Apr 12 07:51:22 2012 Return-Path: X-Original-To: libxmlplusplus-list@gnome.org Delivered-To: libxmlplusplus-list@gnome.org Received: from localhost (localhost.localdomain [127.0.0.1]) by menubar.gnome.org (Postfix) with ESMTP id 1A52C750393 for ; Thu, 12 Apr 2012 07:51:22 +0000 (UTC) X-Virus-Scanned: by amavisd-new at gnome.org X-Spam-Flag: NO X-Spam-Score: -2.6 X-Spam-Level: X-Spam-Status: No, score=-2.6 tagged_above=-999 required=2 tests=[BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, RCVD_IN_DNSWL_LOW=-0.7] autolearn=ham Received: from menubar.gnome.org ([127.0.0.1]) by localhost (menubar.gnome.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id bBmMIbf7T-O3 for ; Thu, 12 Apr 2012 07:51:20 +0000 (UTC) Received: from out1-smtp.messagingengine.com (out1-smtp.messagingengine.com [66.111.4.25]) by menubar.gnome.org (Postfix) with ESMTP id 283D77501FD for ; Thu, 12 Apr 2012 07:51:11 +0000 (UTC) Received: from compute2.internal (compute2.nyi.mail.srv.osa [10.202.2.42]) by gateway1.nyi.mail.srv.osa (Postfix) with ESMTP id ABA1F21514; Thu, 12 Apr 2012 03:51:10 -0400 (EDT) Received: from frontend2.nyi.mail.srv.osa ([10.202.2.161]) by compute2.internal (MEProxy); Thu, 12 Apr 2012 03:51:10 -0400 DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d= messagingengine.com; h=message-id:subject:from:to:cc:date :in-reply-to:references:content-type:content-transfer-encoding :mime-version; s=smtpout; bh=HQ6XwCof5MHXWNZV/koevLm9aEQ=; b=kEm yH9DcxPWfnsMvf/K8iDbAOh363Qf4nk2THPgYwOW9cC+GBcK4Zbi6r3537pT+0+L yH2f+M1wKNgQF6AzGvIOI7p5HjYgcFFCe9/+gUJPBe2HeAfZfDGSxARWg0qrep0F UqVnNAy0rFgY4qatzJi6GXgOa8pyA4YyO5jyif5Y= X-Sasl-enc: E44uzuP3SigTAiadl69hYis5rkXn3hTGwR5BgaGOOHys 1334217070 Received: from [192.168.178.24] (ppp-188-174-88-102.dynamic.mnet-online.de [188.174.88.102]) by mail.messagingengine.com (Postfix) with ESMTPSA id 056EE4827C3; Thu, 12 Apr 2012 03:51:09 -0400 (EDT) Message-ID: <1334217067.2575.11.camel@murrayc-desktop> Subject: Re: Shouldn't LIBXMLCPP_EXCEPTIONS_ENABLED be defined? From: Murray Cumming To: Kjell Ahlstedt Date: Thu, 12 Apr 2012 09:51:07 +0200 In-Reply-To: <4F8683F8.5090507@bredband.net> References: <4F8683F8.5090507@bredband.net> Content-Type: text/plain; charset="UTF-8" X-Mailer: Evolution 3.2.3-0ubuntu5 Content-Transfer-Encoding: 7bit Mime-Version: 1.0 Cc: libxmlplusplus-list@gnome.org X-BeenThere: libxmlplusplus-list@gnome.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: libxml++ mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 12 Apr 2012 07:51:22 -0000 On Thu, 2012-04-12 at 09:27 +0200, Kjell Ahlstedt wrote: > After the --disable-api-exceptions configure option was removed (commit > 81fead80bc5d0cc6f6188fd2d0f883def0e9a01e), LIBXMLCPP_EXCEPTIONS_ENABLED > is not defined in libxml++/config.h. > > Application programs that contain code such as > > #ifdef LIBXMLCPP_EXCEPTIONS_ENABLED > try > { > #endif //LIBXMLCPP_EXCEPTIONS_ENABLED > ......... > ......... > #ifdef LIBXMLCPP_EXCEPTIONS_ENABLED > } > catch (const xmlpp::exception& ex) > { > std::cout << "Exception caught: " << ex.what() << std::endl; > } > #endif //LIBXMLCPP_EXCEPTIONS_ENABLED > > will not catch exceptions. > > Compare e.g. glibmm. glibmm/configure.ac contains > AC_DEFINE([GLIBMM_EXCEPTIONS_ENABLED],[1], [This is always set. This > is only for backwards compatibility.]) > and GLIBMM_EXCEPTIONS_ENABLED is defined in glibmm/config.h. > > Shouldn't libxml++/configure.ac contain > AC_DEFINE([LIBXMLCPP_EXCEPTIONS_ENABLED],[1], [This is always set. > This is only for backwards compatibility.]) > until the next API break? Yes, you are right. Please push that change. -- Murray Cumming murrayc@murrayc.com www.murrayc.com www.openismus.com From kjell.ahlstedt@bredband.net Thu Apr 12 14:23:06 2012 Return-Path: X-Original-To: libxmlplusplus-list@gnome.org Delivered-To: libxmlplusplus-list@gnome.org Received: from localhost (localhost.localdomain [127.0.0.1]) by menubar.gnome.org (Postfix) with ESMTP id BA06B75040A for ; Thu, 12 Apr 2012 14:23:06 +0000 (UTC) X-Virus-Scanned: by amavisd-new at gnome.org X-Spam-Flag: NO X-Spam-Score: -1.901 X-Spam-Level: X-Spam-Status: No, score=-1.901 tagged_above=-999 required=2 tests=[BAYES_00=-1.9, RCVD_IN_DNSWL_NONE=-0.0001, SPF_PASS=-0.001] autolearn=ham Received: from menubar.gnome.org ([127.0.0.1]) by localhost (menubar.gnome.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id T3Wjw1rNazNu for ; Thu, 12 Apr 2012 14:23:04 +0000 (UTC) Received: from smtprelay-b11.telenor.se (smtprelay-b11.telenor.se [62.127.194.20]) by menubar.gnome.org (Postfix) with ESMTP id 144AF750195 for ; Thu, 12 Apr 2012 14:22:55 +0000 (UTC) Received: from ipb2.telenor.se (ipb2.telenor.se [195.54.127.165]) by smtprelay-b11.telenor.se (Postfix) with ESMTP id 892D5DB2D for ; Thu, 12 Apr 2012 16:22:51 +0200 (CEST) X-SMTPAUTH-B2: [kjelahls] X-SENDER-IP: [85.227.232.137] X-LISTENER: [smtp.bredband.net] X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: ArEZAHnkhk9V4+iJPGdsb2JhbAANN4VmtBkBAQEBN4I9AQEBAQMjFUABEAsYAgIFFgsCAgkDAgECATEUBg0BBwEBiBWndZMFgS+PN4EYBJZ9iEWJSQ X-IronPort-AV: E=Sophos;i="4.75,411,1330902000"; d="scan'208";a="310092124" Received: from c-89e8e355.06-203-73746f44.cust.bredbandsbolaget.se (HELO [192.168.1.64]) ([85.227.232.137]) by ipb2.telenor.se with ESMTP; 12 Apr 2012 16:22:51 +0200 Message-ID: <4F86E53A.5010105@bredband.net> Date: Thu, 12 Apr 2012 16:22:50 +0200 From: Kjell Ahlstedt User-Agent: Mozilla/5.0 (X11; Linux i686; rv:11.0) Gecko/20120329 Thunderbird/11.0.1 MIME-Version: 1.0 To: Murray Cumming Subject: Re: Shouldn't LIBXMLCPP_EXCEPTIONS_ENABLED be defined? References: <4F8683F8.5090507@bredband.net> <1334217067.2575.11.camel@murrayc-desktop> In-Reply-To: <1334217067.2575.11.camel@murrayc-desktop> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Cc: libxmlplusplus-list@gnome.org X-BeenThere: libxmlplusplus-list@gnome.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: libxml++ mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 12 Apr 2012 14:23:07 -0000 2012-04-12 09:51, Murray Cumming skrev: > On Thu, 2012-04-12 at 09:27 +0200, Kjell Ahlstedt wrote: >> Shouldn't libxml++/configure.ac contain >> AC_DEFINE([LIBXMLCPP_EXCEPTIONS_ENABLED],[1], [This is always set. >> This is only for backwards compatibility.]) >> until the next API break? > Yes, you are right. Please push that change. > Done. http://git.gnome.org/browse/libxml++/commit/?id=950627ed11e2ddf6ced38178ccc17b2cc9752340 Kjell