Usefull Tips

Recommend this page to a friend!

      XmlNode  >  All threads  >  Usefull Tips  >  (Un) Subscribe thread alerts  
Subject:Usefull Tips
Summary:Put here usefull tips
Author:Julio Cezar Novais Raffaine
Date:2007-06-21 15:49:42

  1. Usefull Tips   Reply   Report abuse  
Julio Cezar Novais Raffaine - 2007-06-21 15:49:42
First Tip:
- How to delete nodes.
First, you need to change function toXML().
Add a verification in the second foreach. like:
if(child != NULL) {
bla bla bla
This is important, cause if you don't do this, you are going to receive error messages.
After this, just get the node you want to delete, and do something like this:
$node =& $root->findFirstChild($name);
$node = NULL;
$xml = $root->toXML(0);
After this just write $xml in a file, and it's done, you don't have that node anymore. Simple isn't it.

That's all Folks.


For more information send a message to info at phpclasses dot org.