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: [BULK] - Re: Deleting a Node
by Bruce Miller other posts by this author
Nov 13 2006 4:04PM messages near this date
view in the new Beta List Site
RE: [BULK] - Re: Deleting a Node | RE: [BULK] - Re: Deleting a Node
& XSLT Mesdaq, Ali wrote:
>  Actually what I ended up doing and it looks like its working perfectly
>  so far is.
>  
>  In my loop of the nodes I have this at the end.
>  
>  $root->removeChild($_);
>  $tree->toFile($xmlfile);

Yep, that should work, even if it isn't "ideal".
Since you were concerned about crashes, you might
mv the $xmlfile to $xmlfile.bak or something before
writing.  That way, you'd end up with something usable
in any case.

>  $xmlfile is the file that I am reading from. This means that during my
>  loop I don't reload the file. I just read the tree once but I keep
>  saving the newer version back to disk so that if I ever do have to
>  reload the tree it will be the updated version.


-- 
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