ASPN ActiveState Programmer Network
ActiveState
/ Home / Perl / PHP / Python / Tcl / XSLT /
/ Safari / My ASPN /
Cookbooks | Documentation | Mailing Lists | Modules | News Feeds | Products | User Groups


Recent Messages
List Archives
About the List
List Leaders
Subscription Options

View Subscriptions
Help

View by Topic
ActiveState
.NET Framework
Open Source
Perl
PHP
Python
Tcl
Web Services
XML & XSLT

View by Category
Database
General
SOAP
System Administration
Tools
User Interfaces
Web Programming
XML Programming


MyASPN >> Mail Archive >> perl-xml
perl-xml
Re: Deleting a Node
by Bruce Miller other posts by this author
Nov 13 2006 9:26AM messages near this date
view in the new Beta List Site
Re: Deleting a Node | Re: Deleting a Node
& XSLT Mesdaq, Ali wrote:
>  I am using xml to keep a list of items I need to loop through. But I
>  would like to delete the items as I am looping through. So in case if
>  the system crashes and I boot back up I know where to continue from. So
>  now a few questions I have regarding that. 
>  
>  One is what do I use to delete the node?

it's removeChild, but that is only going to affect the
_in_memory_ tree; it isn't going to help recover
from crashes unless you serialize & write the dom
back to a file after each removal.

I was looking through the
>  documentation for libxml on cpan and I see "replaceNode" in the
>  XML::LibXML::Node library but it seems like it keeps a copy around which
>  seems to be a little inefficient. I am pretty sure there is probably a
>  better function for this but I couldn't find it and I would imagine it
>  would be in the XML::LibXML::Node library. 
>  
>  Second question is about the reliability of either the replaceNode call
>  or whatever the better function call is. How reliable is that call? If I
>  call that is there a chance the document could be in a non-valid state?
>  Or will that call ensure that it only deletes that node and not delete
>  it partially?

Not completely clear what you mean;
You certainly can replace the node by a node that isn't allowed
by the dtd/schema, so it can easily be non valid in that sense.

>  
>  Thanks in advance.
>  _______________________________________________
>  Perl-XML mailing list
>  Perl-XML@[...].com
>  To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs


-- 
bruce.miller@[...].gov
http://math.nist.gov/~BMiller/
_______________________________________________
Perl-XML mailing list
Perl-XML@[...].com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
Thread:
Ali Mesdaq
Liam Quin
Bruce Miller
Chilkat Software
Ali Mesdaq
Robin Berjon
Ali Mesdaq
Bruce Miller
Ali Mesdaq
Bruce Miller
Ali Mesdaq
John Saylor

Privacy Policy | Email Opt-out | Feedback | Syndication
© ActiveState Software Inc. All rights reserved