phpxpath-users Mailing List for Php.XPath (Page 11)
Brought to you by:
bs_php,
nigelswinson
You can subscribe to this list here.
2001 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
(346) |
Nov
(8) |
Dec
(21) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2002 |
Jan
(30) |
Feb
(13) |
Mar
|
Apr
(3) |
May
(70) |
Jun
(26) |
Jul
(48) |
Aug
(22) |
Sep
(1) |
Oct
(4) |
Nov
|
Dec
|
2003 |
Jan
(3) |
Feb
(3) |
Mar
(11) |
Apr
(3) |
May
(4) |
Jun
(3) |
Jul
(2) |
Aug
(1) |
Sep
|
Oct
|
Nov
|
Dec
(2) |
2004 |
Jan
(4) |
Feb
(2) |
Mar
(2) |
Apr
(2) |
May
|
Jun
|
Jul
(12) |
Aug
(8) |
Sep
(2) |
Oct
(2) |
Nov
(3) |
Dec
|
2005 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
(1) |
Aug
(2) |
Sep
|
Oct
(1) |
Nov
(1) |
Dec
|
2006 |
Jan
(3) |
Feb
(7) |
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2010 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
(1) |
Nov
|
Dec
|
From: Philipp L. <le...@hi...> - 2002-05-08 18:34:07
|
I successfully downloaded the new version and replaced version 2.2. However, my forum now doesn't work anymore. It doesn't cause an error, it just returns an array of count 0. This is my XPathQuery, which I pass to ->match ... posts/post[@replyTo = '0'] on the document-root of data like this, submitted via ->importFromString: <?xml version="1.0"?> <posts> <!-- "about" section --> <post id="43" replyTo="0"> <title>Question</title> <author>xyz</author> <text>....</text> </post> <post id="45" replyTo="43"> <title>Re: Question</title> <author>abc</author> <text>....</text> </post> <!-- ... many more posts --> </posts> The forum overview does still work the same (it checks for the latest post and latest author). Am I doing something wrong or is this a bug in the 3.0 beta version? |
From: Nigel S. <nig...@us...> - 2002-05-08 10:55:46
|
Damn. I'd uploaded it as ascii. Ooops.. Please try again now. Both packages should be fine now. If not then drop me a mail again. =========================== For the most recent version of Php.XPath, and an archive of this list visit: http://www.sourceforge.net/projects/phpxpath |
From: Philipp L. <le...@hi...> - 2002-05-08 03:27:43
|
Hmm, I get a corrupted ZIP file message trying to unpack the downloads (I tried different servers provided). WinZip alerts me that 400 something bytes are missing... |
From: Philipp L. <le...@hi...> - 2002-05-08 03:05:04
|
From: "Nigel Swinson" <nig...@us...> >.. > Anyway version 3.0 is here, and it is 50% faster at reading, 40% faster at > writing (at least it is on my home system), and the internal structure has > been mashed about to make it much more maintainable, sensible and faster. >.. This is great news. I will replace it on the systems I use it at (namely at http://questml.com and http://outer-court.com/tech/forum.htm ) and of course do some Beta testing. BTW is it normal that e.g. "myElement | myOtherElement" (or maybe ".//myElement | .//myOtherElement") will return the elements not in the order they appear in the XML, but in the order as listed in the XPath-string? I wish they could be listed as appearing in the XML, as this is the result I get from MSXML. Is it not standardized, and up to the XPath-parser to decide the returned order, or simply a PHPXPath bug? I'd really need the above-mentioned in my QML interpreter, and now have to resort to xpath = "./*" .... switch ($elementNodeName...) { case "myElement": ... case "myOtherElement": ... } which then works in the order I expected. (But has little advantage to XML-DOM childNodes...) |
From: Nigel S. <nig...@us...> - 2002-05-08 00:45:36
|
Well you've all been mighty quiet recently, which is nice in some ways, but hopefully it's not because you hate the class and aren't using it. The project has broken the 4000 downloads barrier in the space of 8 months, so presumably there are still users out there somewhere :o) Anyway version 3.0 is here, and it is 50% faster at reading, 40% faster at writing (at least it is on my home system), and the internal structure has been mashed about to make it much more maintainable, sensible and faster. It's a beta though, and needs to be considered as such, so please don't kill your production sites just yet and do some backing up and testing before you roll it out anywhere. We have a fairly large test harness now, so I think it's fairly sound, but then who out there can guarentee their code has no bugs? Project page and downloads: https://sourceforge.net/projects/phpxpath/ Change log: http://www.carrubbers.org/scripts/php/xpath/Changes.html Documentation: http://www.carrubbers.org/scripts/php/xpath/doc/ Test Harness: http://www.carrubbers.org/scripts/php/xpath/testBench/ Enjoy, :o) Nigel =========================== For the most recent version of Php.XPath, and an archive of this list visit: http://www.sourceforge.net/projects/phpxpath |
From: Philipp L. <le...@hi...> - 2002-04-19 07:39:56
|
I put my little own getAttribute() function in the class. Did I miss something or is there really only getAttributes(), and if there's no attribute of that kind available it causes an error? That were my experience with v2.20. Well I use a DTD to my XML that even expands some attributes to a value if none is given but I guess DTDs aren't parsed. Another question, how can/ should I comment the class now that I did a little change? I tried to scan the mozilla license for some information. I hope it's not illegal to redistribute the class inside my package (it's not the core, I just use it for the free QML-interpreter at http://questml.com ). My own function actually returns not null but an empty string if the attribute is not found, which I think is not really standard but very nice for my own purpoes. Now in case it's not a workaround for something that's already in the class here goes my source (just as reference with no intend to have it in any "official" version). function getAttribute($absoluteXPath, $attributeName) { $attributeValue = ""; $attributes = $this->getAttributes($absoluteXPath); foreach ($attributes as $key => $value) { if ($key == $attributeName && $attributeValue == "") $attributeValue = $value; } return $attributeValue; } |
From: Nigel S. <nig...@us...> - 2002-04-18 21:47:40
|
Line 2400 of Php.XPath for me reads: // Check whether the function handling function is available. if (!method_exists(&$this, $method)) { // Display an error message. $this->_displayError("While parsing an XPath expression, ". "the function \"$function\" could not be handled, because this ". "version does not support this function.", __LINE__, __FILE__); } if ($bDebugThisFunction) echo "Calling function $method($absoluteXPath, $arguments)\n"; As obviously I'm using the development version. Which one are you using?? I think your fix is probably right. Put it this way, if it didn't do what you wanted it to do beforehand, and it does now, then it's probably right :o) CData has always been a bit of a mess with Php.XPath. I -think- it's handled better in the development version soon to be released as V3. But I think there's still a little more work to do. After performance, it is probably next on the hit list.... Nigel =========================== For the most recent version of Php.XPath, and an archive of this list visit: http://www.sourceforge.net/projects/phpxpath ----- Original Message ----- From: "Nigel Armstrong" <Nig...@te...> To: <nig...@us...> Sent: Thursday, April 18, 2002 5:33 PM Subject: Entity handling in PHP-XPath > Hi, > > I have a query about the code around line 2400 of XPath.class.php: > > // Replace entities. > if (!$this->inCData) > $text = strtr($text, $this->entities); > > This code does not do what the comment suggests. Instead it encodes > 'special' characters in the text as entites. Any entities in the text > get 'doubly coded' - eg. " becomes &quot; > > I think the code should be:- > > // Replace entities. > if (!$this->inCData) > $text = strtr($text, array_flip($this->entities)); > > That's what I have in my local copy at the moment. What do you think? > > |
From: Philipp L. <le...@hi...> - 2002-04-13 19:58:11
|
I'm using PHP.XPath for my QML-interpreter port (as well as the QML forum). You can find them at http://questml.com Feedback welcome. |
From: Peter R. <php...@pe...> - 2002-02-22 19:40:15
|
Following on from my posting yesterday re speed of 'evaluate', here's a tip to all users: = avoid all inessential evaluates Given xml structure of many unsorted child nodes which may or may not be present, for example: <topnode> <a/><d/><q/><m/><c/> etc </topnode> and you want the contents of <d> <r> <l> <h> etc Don't do as I originally did and do an evaluate for each of the children. Do an evaluate for all children of <topnode>, then use PHP's array functions to find whether a child exists, then getData for those that exist. This is substantially faster. And if you know a node exists, don't do an evaluate at all - just getData. |
From: Nigel S. <nig...@us...> - 2002-02-22 00:10:08
|
Yeah I'm pretty sure that there is a bug in the predicate parsing, but = am not completely sure what is wrong which kinda makes it hard to fix... If you can mail in xml files, with XPath and nodes that should be = selected by the op, then that would be helpful. I've got a couple of = tests that fail, but I haven't had the time to definatively work out if = Php.XPath definately is doing the wrong thing... Sadly I don't see this getting fixed any time soon, the next two months = are very busy for me at the moment, can't speak for Sam and Dan, and = we're fairly deep into V3 at the moment... 4.3 Test xQuery =3D '//*[last()]' =20 <AAA> <BBB/> <BBB/> <BBB/> <BBB/> </AAA> <AAA> <BBB/> <BBB/> <BBB/> <BBB/> </AAA> =20 Recived Expected=20 /AAA[1] /AAA[1]/BBB[4]=20 /AAA[1]/BBB[4] - missing -=20 =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D For the most recent version of Php.XPath, and an archive of this list = visit: http://www.sourceforge.net/projects/phpxpath |
From: Peter R. <php...@pe...> - 2002-02-21 14:01:19
|
Going back to this thread, I've been looking into this a bit further and I find that getAttributes works as I would like whereas getData doesn't. So if I do getAttributes( ... specific attribute that doesn't exist) it returns false, so I can do if ($var = getAttributes) do whatever with $var; which is what I want. Bizarrely, if I do the same with getData, i.e. for a path to an attribute that doesn't exist, it fails with an error. So rather than different levels of reporting, I think all I really need is for getData (and for that matter nodeName, which has the same problem) to behave like getAttributes and return false if the node does not exist. At the moment, given a xml file with variable structure, evaluate seems to be the only way of getting, for example, a list of child nodes or finding if a particular node exists. Evaluate, though, seems to really slow things down. I've just converted one such file from phpxml to phpxpath, thinking that it would speed things up, and it's actually substantially slower - I think because of all the evaluates that I have to include to check whether child nodes exist or not. On Friday 18 Jan 2002 12:02 am, Nigel Swinson wrote: > > > > I have an xml file with large numbers of child (+ grandchild ...) nodes which > > may or may not be present. My old phpxml script did an evaluate for the > top > > level and then get_Contents for any children it needed; if a child didn't > > exist, phpxml simply set the variable to null. phpxpath, however, seems > > to throw an error and refuse to continue if you try and getData or > getDataParts > > > for a child or attribute that doesn't exist. If I have to do a > > match/evaluate > > > for each of these nodes before getData, not only is that a lot of extra > > work > > > but I'll probably have to rewrite the logic. > > > > Can phpxpath be changed to be like phpxml and simply set the variable to > > null > > > if getData doesn't find the node? > > A good point. Sounds annoying. :o( > > I think the plan is to support different levels of error reporting, so when > you build the class, you set an option to say what kind of errors you want. > So what you'd do then is say that you don't want errors if the node doesn't > exist and you'd be happy, and if you want it to complain, you can leave the > errors on. So yeah, we are aiming for this too :o) |
From: Peter R. <php...@pe...> - 2002-02-21 14:01:18
|
On Thursday 21 Feb 2002 5:44 am, Dietrich Ayala wrote: > But if you have "paris" nodes that have *different* parents, then you may > receive multiple nodes, as each my be the last child of the respective > context node. yes, unless I use the context parameter. Either way it should return something and not fall over with an error. |
From: Peter R. <php...@pe...> - 2002-02-21 14:01:18
|
On Wednesday 20 Feb 2002 11:58 pm, Nigel Swinson wrote: > > I tried: > > //employee[(@gender='m') and (position() = last())] > > against: > > company-structure.xml This is not the same thing. This is the last employee in each parent node if male (or in my example the last of each tango which is in Paris, i.e. all tangos in Paris). What I want is the last instance of all male employees, i.e. //employee[@gender='m'][last()] should find a1010 and gender = 'f' should find a1006. Incidentally, if I try //employee[(@gender='m') and (last())] I get a different answer to your example. What is this doing? 'Position() = last()' and 'last()' should surely be identical. |
From: Dietrich A. <die...@ga...> - 2002-02-21 02:36:07
|
Nigel, is multiple predicates implemented? ie: //node-test[myPredicate1][myPredicate2] if it's not, it would explain the "too many brackets" error. Peter, assuming that you actually have a tango element that contains the attribute "place" with a value of "paris" *and* all the "paris" nodes contain the same immediate parent, then the original xpath expression is correct and should only return 1 node: //tango[@place="paris"][last()] But if you have "paris" nodes that have *different* parents, then you may receive multiple nodes, as each my be the last child of the respective context node. From the spec, section 2.5 Abbreviated Syntax: "para[last()] selects the last para child of the context node" - d. > -----Original Message----- > From: php...@li... > [mailto:php...@li...]On Behalf Of Nigel > Swinson > Sent: Wednesday, February 20, 2002 3:59 PM > To: php...@li... > Subject: Re: Last tango in Paris > > > > If I have a lot of tango nodes with a place attribute, and I want to find > the > > 5th tango in Paris, according to the Xpath definition, I should be able to > do: > > > > tango[@place="Paris"][5] > > > > similarly, if I want to find the last tango in Paris, I should be able to > do: > > > > tango[@place="Paris"][last()] > > > > However, I've tried numerous variations on this in the usecases testbench > and > > can't get it to work - it either finds nothing or tells me there's an > invalid > > number of brackets. I can find all the tangos in Paris, and the last > tango, > > but not the two together. Is this a bug, something not handled (yet?), or > is > > there some other notation I can use? (ok, I know I can fetch all the > tangos > > in Paris and then use PHP to get the last in the array.) > > I wonder if this is related to the fact that //*[last()] returns multiple > nodes instead of one? > > I tried: > > //employee[(@gender='m') and (position() = last())] > > against: > > company-structure.xml > > at: > > http://www.carrubbers.org/scripts/php/xpath/testBench/useCases/index.php > > And it returns: > > [0] => /company[1]/department[1]/employee[2] > [1] => /company[1]/department[2]/employee[2] > [2] => /company[1]/department[4]/employee[2] > [3] => /company[1]/department[5]/employee[2] > > Where: > > //employee[(@gender='m')] > > Returns: > > [0] => /company[1]/department[1]/employee[1] > [1] => /company[1]/department[1]/employee[2] > [2] => /company[1]/department[2]/employee[1] > [3] => /company[1]/department[2]/employee[2] > [4] => /company[1]/department[3]/employee[1] > [5] => /company[1]/department[4]/employee[1] > [6] => /company[1]/department[4]/employee[2] > [7] => /company[1]/department[5]/employee[1] > [8] => /company[1]/department[5]/employee[2] > > Is that any use?? > > Nigel > > =========================== > For the most recent version of Php.XPath, and an archive of this list visit: > http://www.sourceforge.net/projects/phpxpath > > > _______________________________________________ > Phpxpath-users mailing list > Php...@li... > https://lists.sourceforge.net/lists/listinfo/phpxpath-users > |
From: Nigel S. <nig...@us...> - 2002-02-20 23:58:43
|
> If I have a lot of tango nodes with a place attribute, and I want to find the > 5th tango in Paris, according to the Xpath definition, I should be able to do: > > tango[@place="Paris"][5] > > similarly, if I want to find the last tango in Paris, I should be able to do: > > tango[@place="Paris"][last()] > > However, I've tried numerous variations on this in the usecases testbench and > can't get it to work - it either finds nothing or tells me there's an invalid > number of brackets. I can find all the tangos in Paris, and the last tango, > but not the two together. Is this a bug, something not handled (yet?), or is > there some other notation I can use? (ok, I know I can fetch all the tangos > in Paris and then use PHP to get the last in the array.) I wonder if this is related to the fact that //*[last()] returns multiple nodes instead of one? I tried: //employee[(@gender='m') and (position() = last())] against: company-structure.xml at: http://www.carrubbers.org/scripts/php/xpath/testBench/useCases/index.php And it returns: [0] => /company[1]/department[1]/employee[2] [1] => /company[1]/department[2]/employee[2] [2] => /company[1]/department[4]/employee[2] [3] => /company[1]/department[5]/employee[2] Where: //employee[(@gender='m')] Returns: [0] => /company[1]/department[1]/employee[1] [1] => /company[1]/department[1]/employee[2] [2] => /company[1]/department[2]/employee[1] [3] => /company[1]/department[2]/employee[2] [4] => /company[1]/department[3]/employee[1] [5] => /company[1]/department[4]/employee[1] [6] => /company[1]/department[4]/employee[2] [7] => /company[1]/department[5]/employee[1] [8] => /company[1]/department[5]/employee[2] Is that any use?? Nigel =========================== For the most recent version of Php.XPath, and an archive of this list visit: http://www.sourceforge.net/projects/phpxpath |
From: Peter R. <php...@pe...> - 2002-02-20 19:15:58
|
If I have a lot of tango nodes with a place attribute, and I want to find the 5th tango in Paris, according to the Xpath definition, I should be able to do: tango[@place="Paris"][5] similarly, if I want to find the last tango in Paris, I should be able to do: tango[@place="Paris"][last()] However, I've tried numerous variations on this in the usecases testbench and can't get it to work - it either finds nothing or tells me there's an invalid number of brackets. I can find all the tangos in Paris, and the last tango, but not the two together. Is this a bug, something not handled (yet?), or is there some other notation I can use? (ok, I know I can fetch all the tangos in Paris and then use PHP to get the last in the array.) |
From: Nigel S. <nig...@us...> - 2002-02-07 03:36:29
|
This was passed on to me today. I thought it might be of some interest to you regarding the speed of PHP with comments. It appears that this isn't an issue... phew! ----- Original Message ----- From: "Axel Tietje" To: "Nigel Swinson" <nig...@us...> Sent: Wednesday, February 06, 2002 1:24 PM Subject: Re: A task for someone - a comment remover. > Hi, > > <cite> > TLK: Effects of commenting your PHP code > > Moritz Petersen posted an interesting question to the PHP > developers' list this week: whether comments slowed down the > execution of the PHP script. Andi Gutmans responded that due to > the way the interpreter is written, there are no speed losses > from having comments in your code. > </cite> > > Source: http://www.zend.com/zend/week/week20.php#Heading8 > > > Have a nice day, > > Axel > -- > FLYnet FLYer Kommunikationsgesellschaft mbH > Weender Landstr. 46 37073 Göttingen 0551-499750 > http://www.flynet.de |
From: Nigel S. <nig...@us...> - 2002-02-05 12:18:23
|
> this sounded like fun, so I wrote a simple "comment remover" for PHP > source code. Tested it on some 50,000 lines of our PHP code and it > didn't break anything ... Wow that was quick!! > It is written in PHP because I don't like Perl :) The code is > intentionally not optimized for efficiency, but for comprehensibility. > What do you think about it? I've just run it and it does indeed not break anything :o) It totally doesn't need to be optimized, so I quite agree with your choice of readability. (I agree too. Perl is a bit wierd...) > I have attached the code to this mail - I hope attachments are OK on > this list. Yip, provided they are less than 100KB > Test it like this: > > php -q commentremover.php yourfile.php > yourfile_nocomments.php > > Please note that this currently removes ALL comments. Special handling > for the copyright + version comments is not implemented yet. We'd need to add this, but that's the hardest bit done. It might be nice to remove the empty lines where the comments came from too? > I hope this seems useful to you. Yeah I just did some testing to find out how much difference it made. Size wize, pretty stunning. We went from 199KB to 99KB. Performance wise I barely noticed a difference though. Hmmm. Perhaps it's dependant on platform and hardware? Running the getLastChild DOM tests takes 90ms with the normal class, and 92ms with the stripped down class :o/ Running the appendChild tests takes 325ms with the normal class and about 327ms with the stripped down class. I'm Win 2000 Prof, SP2, Athlon XP 1.4GHZ, Php 4.1.1 Does anyone else have any stats they could share?? Does it really make a difference? We might ship a commentless version anyway, cos halfing the size of the file is bound to do something good... Opinions? Nigel |
From: Tim S. <ti...@di...> - 2002-02-05 10:40:12
|
Hello, Nigel Swinson wrote: > XPath.production.class.php will functionally be the same as XPath.class.php, > but will have ALL the comments removed apart from the copyright and version > header at the top. > > Is there anyone out there who could write this for us? It seems like a > fairly self contained task that wouldn't take too long. You could base it > on the GeneratePhpDocumentation.pl Perl script that ships with the module > perhaps? > > Anyway if there is anyone out there who would like to do this, let us know. this sounded like fun, so I wrote a simple "comment remover" for PHP source code. Tested it on some 50,000 lines of our PHP code and it didn't break anything ... It is written in PHP because I don't like Perl :) The code is intentionally not optimized for efficiency, but for comprehensibility. What do you think about it? I have attached the code to this mail - I hope attachments are OK on this list. Test it like this: php -q commentremover.php yourfile.php > yourfile_nocomments.php Please note that this currently removes ALL comments. Special handling for the copyright + version comments is not implemented yet. I hope this seems useful to you. Regards, Tim -- ------------------------------------------------------- Tim Strehle Development Digital Collections Phone: +49 40 235 35 0 Hammerbrookstr. 93 Fax: +49 40 235 35 180 20097 Hamburg / Germany http://www.digicol.com ------------------------------------------------------- |
From: Nigel S. <nig...@us...> - 2002-02-04 22:04:02
|
One of our users has made the observation that the PHP source parser is contributing heavily to the performance of this module: https://sourceforge.net/tracker/index.php?func=detail&aid=496498&group_id=36 731&atid=417619 To address this we'd like to ship two versions of XPath.class.php: 1) XPath.class.php 2) XPath.production.class.php XPath.production.class.php will functionally be the same as XPath.class.php, but will have ALL the comments removed apart from the copyright and version header at the top. Is there anyone out there who could write this for us? It seems like a fairly self contained task that wouldn't take too long. You could base it on the GeneratePhpDocumentation.pl Perl script that ships with the module perhaps? Anyway if there is anyone out there who would like to do this, let us know. Cheers, Nigel =========================== For the most recent version of Php.XPath, and an archive of this list visit: http://www.sourceforge.net/projects/phpxpath |
From: Nigel S. <nig...@us...> - 2002-02-02 16:33:27
|
Long over due, but finally here, we now have a Php.XPath 2.2. Loads of bug fixes, some new functions, and a much more indepth test harness to help us with bugs in the future. The old interface will now be binned, so this is your last chance to upgrade your code to the DOM function names. Sam and Dan have already made major progress into version 3 and the priority now seems to be getting performance nearer where it needs to be :o) Project page and downloads: https://sourceforge.net/projects/phpxpath/ Change log: http://www.carrubbers.org/scripts/php/xpath/Changes.html Documentation: http://www.carrubbers.org/scripts/php/xpath/doc/ Test Harness: http://www.carrubbers.org/scripts/php/xpath/testBench/ Keep those bugs rolling in... :o) Nigel =========================== For the most recent version of Php.XPath, and an archive of this list visit: http://www.sourceforge.net/projects/phpxpath |
From: Nigel S. <nig...@us...> - 2002-01-19 15:10:06
|
> > I think the plan is to support different levels of error reporting, so when > > you build the class, you set an option to say what kind of errors you want. > > So what you'd do then is say that you don't want errors if the node doesn't > > exist and you'd be happy, and if you want it to complain, you can leave the > > errors on. So yeah, we are aiming for this too :o) > > sounds good to me. > > Don't want to be a pest, but . . . got any idea of an ETA? At the moment, I'm > still running the original phpxml script, which is not the most rapid . . . Think the plan is something as follows: - Finish the test harness V2.3 - February/March - Tidy and clean up whitespace issues V2.4 - April/May - Enhance and optimize V2.5- Summer But then you know how these things go. The brakes have been on fairly hard over Christmas as I was building my new hardware and software. Sam and Dan have both been very busy too. Under no circumstances should you "plan" round these release dates. I'm just giving you an idea as to what the targets are in my mind. :o) Nigel |
From: Peter R. <php...@pe...> - 2002-01-19 14:50:57
|
On Friday 18 Jan 2002 12:02 am, Nigel Swinson wrote: > > I think the plan is to support different levels of error reporting, so when > you build the class, you set an option to say what kind of errors you want. > So what you'd do then is say that you don't want errors if the node doesn't > exist and you'd be happy, and if you want it to complain, you can leave the > errors on. So yeah, we are aiming for this too :o) sounds good to me. Don't want to be a pest, but . . . got any idea of an ETA? At the moment, I'm still running the original phpxml script, which is not the most rapid . . . |
From: Nigel S. <nig...@us...> - 2002-01-18 18:43:52
|
> What is the most clever way to have an attribute auto incremented ? > > <item id="1"> > <itemvalue>foo</itemvalue> > </item> > > <item id="2"> > <itemvalue>foo</itemvalue> > </item> > > and so on to have the "id" attribute auto incremented ? phpxmldb does something akin to this with RecordIds. You might want to have a look at it. Essentially though you just get the last item id, and add one. Nothing more clever than that. If you build your own super class on top of Php.XPath, then you can create/override the AddRecord() methods to do the work for you. Nigel =========================== For the most recent version of Php.XPath, V2.x, and an archive of this list visit: http://www.sourceforge.net/projects/phpxpath |
From: Nigel S. <nig...@us...> - 2002-01-18 18:41:57
|
> With latest CVS is there a way (a setting switch) to get > > <tag><![CDATA[ content ]]></tag> > > instead of > > <tag>content </tag> > > When doing : > > $xPath->replaceData($path,$content); > > The reason is that I'm French and not only we eat frogs but we use a lot of > extended characters Again, a known issue, planned to be improved upon in the future, to be honest I'm not sure how we currently deal with CDATA, just that it is inadequate. :o) Nigel =========================== For the most recent version of Php.XPath, V2.x, and an archive of this list visit: http://www.sourceforge.net/projects/phpxpath |