[phpXML] Lots of replies in one.
Brought to you by:
bs_php,
nigelswinson
From: <nig...@us...> - 2001-10-09 13:11:50
|
Been sick this week, trying to catch up here so replying to lots in = one... First thanks for all the support that has been shown for the 1.N.X = releases. I will happily continue with the work :o) -------------------------------------------------------------------------= ------- From: <jw...@sh...> > 1. If I want a node like this: <blah>0</blah>, why it becomes <blah/> = ? "0" > is definately content imho... In add_content() (line 650) change this line: $this->nodes[$path]["text"] .=3D $value; to $this->nodes[$path]["text"] .=3D (string)$value; and it will probably fix it. If that doesn't work then you may need to go to the get_file_internal() = function (line 1068) and change =20 if ( empty($this->nodes[$root]["text"]) && !isset($this->nodes[$root]["children"]) ) to =20 if ( isset($this->nodes[$root]["text"]) && !isset($this->nodes[$root]["children"]) ) or perhaps if ( empty((string)$this->nodes[$root]["text"]) && !isset($this->nodes[$root]["children"]) ) Will fix in 1.N.5 -------------------------------------------------------------------------= ------- From: <mf...@mr...> > I don't know every technical term yet: What is a fork? Instrument to = eat? Where a project branches off in two incompatible directions. We = currently have the 1.X branch and the 1.N.X branch. Given that we have = not yet seen 1.1 yet, we don't technically have a fork yet. =20 A fork means wasted development time, dilution of support for the = module, confusion for the users, and other such bad things. If Michael doesn't like the 1.N.X work then we will end up with a fork = and two different branches. I think we are all hoping this won't = happen. -------------------------------------------------------------------------= ------- From: <sh...@co...> > Is there any hope in sight for the problem > with PHP memory being exceeded when trying to parse > large files (not actually even that large, 675K for > example)? Yes. From what I can gather, it isn't so much the loading of large = files that is the problem, it is the performing operations on the files = that is slow. There are two reasons for this. Firstly the internal = nodes array is large, and the operations of the class tend to rebuild = the array completely and then do a $nodes =3D $newnodes command which = means that at some point in the execution path there are two practically = identical arrays in memory. If this array is large, then that's two = large arrays in memory. Not good. I currently only know that the = remove_node() function suffers from this, but there may be others. The second problem is due to stack issues. If you try to call = evaluate() with a not wildly complex expression, then you end up = recusing to a depth of 10 or more calls between the check_predicates, = evaluate_predicates(), evaluate_step() and evaluate() functions. Something can (and will) be done about both of these in the future, as = currently they are crippling the performance. Could you tell me exactly what function calls that you are using of the = phlxml class? Is it definately the parsing that blows up or is it in = doing operations on the class? -------------------------------------------------------------------------= ------- From: <die...@ga...> Subject: [phpXML] RE: [phpXML] Re: Entities > part of the problem is that the entities array is in the wrong order = (as of > the last version i downloaded). I got a bit confused by all the branches of this thread. Could someone = please tell me if there is further work needed on this that isn't fixed = in 1.N.4? Currently it has: var $entities =3D array ( "&" =3D> "&", "<" =3D> "<", ">" = =3D> ">" , '"' =3D> """ ); This array is only used significantly in the handle_character_data() = function. Should this in fact be moved to the add_content() function? = It looks like you could screw your data up by calling = add_content('/Node[1]','><') Why don't we just use htmlspecialchars() instead of this array? Opinions? -------------------------------------------------------------------------= ------- Lastly I'm on holiday for a week starting this Saturday, so I'll shortly = be falling silent on this list until after the 6th of August, so you can = store up lots of goodies and fixes that week for the next 1.N.X release. And if you are new to this list and wondering what on earth a 1.N.X = release is then visit: http://www.sourceforge.net/projects/phpxmldb Cheers all. Nigel |