Re: Flow::delete

Albert Lash <alby-8/[email protected]> Sat, 28 May 2005 00:28:04 -0400 (EDT)
Newsgroups gmane.comp.lib.nexista.devel
Message-ID <[email protected]>
These calls:
$node = Flow::find("get_all_wiki_pages");
Flow::delete($node);

Result with this error:
Notice: Undefined property: DOMNodeList::$parentNode in
/Users/albertlash/Sites/gnu_nexista/nexista/kernel/flow.php on line 280

Fatal error: Call to a member function removeChild() on a non-object in
/Users/albertlash/Sites/gnu_nexista/nexista/kernel/flow.php on line 280

This is where I figured out a solution for multiple nodes:
http://www.phpbuilder.com/board/history/topic.php/10287997-1.html

and

http://uk.php.net/manual/en/function.dom-domnode-removechild.php

and

http://uk.php.net/manual/en/function.dom-domnodelist-item.php

Maybe we need separate functions?

On Fri, 27 May 2005, Joshua wrote:

> I'd like to stick within the DOM API as much as possible. This means using
> xmlnode objects and such. The current delete function does that. The one that
> you have here only works in some cases - when you have a path. You're out of
> luck otherwise. The example I showed earlier is the proper way to a) find the
> node(s) based on the path and then b) delete one, some or all of the nodes
> using delete.
>
>
> On Friday 27 May 2005 9:14 pm, you wrote:
> > I committed this, have you tried it?
> >
> > On Fri, 27 May 2005, Joshua wrote:
> > > It works fine now
> > >
> > > On Friday 27 May 2005 8:35 pm, you wrote:
> > > > Yep, I re-wrote it so that it works. Any suggestions?
> > > >
> > > > On Fri, 27 May 2005, Joshua wrote:
> > > > > Where is this from? not the one in flow
> > > > >
> > > > > > static public function delete($node)
> > > > > >     {
> > > > > > 		$flow=Flow::singleton();
> > > > > > 		$listall=$flow->flowDocument->getElementsByTagname($node);
> > > > > > 		$count = $listall->length;
> > > > > > 		for ($i = 0; $i < $count; $i++) {
> > > > > > 			$myparentnode = $listall->item(0)->parentNode;
> > > > > > 			$myparentnode->removeChild($listall->item(0));
> > > > > > 		}
> > > > > >
> > > > > > 	}
> > > > > >
> > > > > > On Fri, 27 May 2005, Joshua wrote:
> > > > > > > He who reads the docs shall find enlightenment :)
> > > > > > >
> > > > > > > Flow::delete(Flow::find('//quername')); or something like that.
> > > > > > >
> > > > > > > Flow is an extension of the DOM XML api and hence deals with
> > > > > > > objects and such. it offers tons of functionaliy in itself and
> > > > > > > flow just adds a few handy ones. Most of flow needs a node object
> > > > > > > (delete and such) you can use the find command to return an
> > > > > > > object from an xpath
> > > > > > >
> > > > > > > J
> > > > > > >
> > > > > > > On Friday 27 May 2005 1:03 pm, you wrote:
> > > > > > > > Flow::deleteVar was something you helped me with last nx
> > > > > > > > version, but now that xmldata.php is gone, I'm not sure how to
> > > > > > > > implement it.
> > > > > > > >
> > > > > > > > Background:
> > > > > > > > I wanted to delete a large query before XSL proc. It would be:
> > > > > > > >
> > > > > > > > Flow::deleteVar("//queryname");
> > > > > > > >
> > > > > > > > I tried
> > > > > > > >
> > > > > > > > Flow::delete("//queryname"); of course but no luck.
> > > > > > > >
> > > > > > > > Thanks,
> > > > > > > >
> > > > > > > > Al
> > > > > > > >
> > > > > > > > On Fri, 27 May 2005, Joshua wrote:
> > > > > > > > > Nah
> > > > > > > > >
> > > > > > > > > These:
> > > > > > > > > http://ejflavors.com/php/wrappers.php.html
> > > > > > > > >
> > > > > > > > > On Friday 27 May 2005 11:22 am, you wrote:
> > > > > > > > > > Just to make sure, when you say streams, you aren't talking
> > > > > > > > > > about the old flow, are you?
> > > > > > > > > >
> > > > > > > > > > On Fri, 27 May 2005, Joshua wrote:
> > > > > > > > > > > On Friday 27 May 2005 10:29 am, you wrote:
> > > > > > > > > > > > Hi Joshua,
> > > > > > > > > > > >
> > > > > > > > > > > > How are you? What are you working on these days? Are
> > > > > > > > > > > > you still working on a mega-yoga website?
> > > > > > > > > > > >
> > > > > > > > > > > > I'm planning an NX weekend, and was wondering if you
> > > > > > > > > > > > were planning any updates / changes / revolutions
> > > > > > > > > > > > anytime soon. And while I'm at it, anything caught your
> > > > > > > > > > > > attention lately?
> > > > > > > > > > >
> > > > > > > > > > > Hey man
> > > > > > > > > > >
> > > > > > > > > > > I'm taking a month off from my mega site to work for
> > > > > > > > > > > clients. Got to make some $ sometimes :).   No major
> > > > > > > > > > > revolutions though I've completely moved to the db system
> > > > > > > > > > > using php. I'm using the new data objects from php5 -
> > > > > > > > > > > rocks.  strickly mysql but I made support for the pear
> > > > > > > > > > > data objects which supports all.  Only changes I see is
> > > > > > > > > > > what I talked about - making the map:set into an action
> > > > > > > > > > > and the map:if accept a full logic test.  Possibly some
> > > > > > > > > > > changes iin stream access such as using streams for
> > > > > > > > > > > get/post/etc.. instead of the current system. But this
> > > > > > > > > > > would be internal and would not affect the website
> > > > > > > > > > > specific code (if you haven't used streams yet - check it
> > > > > > > > > > > out. ) J
> > > > > > > > > > >
> > > > > > > > > > > > Al
>