phpxpath-users Mailing List for Php.XPath (Page 22)
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: <nig...@us...> - 2001-10-08 14:26:10
|
> I am looking for an alternative to the following syntax > > $courts = $xml->evaluate($result . '/COURTS_SEARCHED/COURT'); > foreach ($courts as $court): > $courtinfo = $xml->get_attributes($court); > print $courtinfo['NAME']; > endforeach; > > is there a shorter way of getting at that attribute. > I triad a variety of @ syntax but nothing I did seems to work. $courts = $xml->evaluate($result . '/COURTS_SEARCHED/COURT'); foreach ($courts as $court): print $xml->getAttributes($court, 'NAME'); endforeach; Is slightly neater. With the current XPath support, I think it's the best you will get. Ultimately there should be some kind of solution where you call getData() instead of getAttribute() with evaluate() returning an array of absoluteXPaths to attribute nodes, but if there is we currently aren't supporting it. ie evaluate would return "/COURTS_SEARCH[1]/COURT[1]/attribute::NAME", and you'd pass this to getAttributes(). You'd end up with the same no. lines of code though, so perhaps it isn't really any neater? Nigel =========================== For the most recent version of phpxml, V1.N.X, and an archive of this list visit: http://www.sourceforge.net/projects/phpxmldb -- This message has been sent through the <phpXML/> user discussion list. To unsubscribe, please visit https://sslsites.de/mailinglisten/user/us...@li.../ |
From: <lu...@sa...> - 2001-10-08 14:24:36
|
Hello, I'm still fighting with xpath.class.php I don't buy the fact the problems I have with xpath.class.php are related to my ISP because xml.php 1N6 works like a charm) and I use it a lot. So I'd to have a detailed explanation of the meaning of the following error : phpXML error: While parsing an XPath expression there was an error in the predicate "Gerhard", because it was the null string. If you wish to seach for the empty string, you must use ''. Context ======== xpath.class.php Line 1996 if (ereg('^\w*$', $predicate)) { // Display an error message. $this->_displayError("While parsing an XPath expression ". "there was an error in the predicate \"$predicate\", ". "because it was the null string. If you wish to seach ". "for the empty string, you must use ''."); return FALSE; } The error occurs when I try to use xpath.class.php with government example in this case searching for Gerhard:: phpXML error: While parsing an XPath expression there was an error in the predicate "Gerhard", because it was the null string. If you wish to seach for the empty string, you must use ''. Question =========== How can the string "Gerhard" be a "null string" ??? Luc -- This message has been sent through the <phpXML/> user discussion list. To unsubscribe, please visit https://sslsites.de/mailinglisten/user/us...@li.../ |
From: <tom...@di...> - 2001-10-08 14:23:02
|
Hello all, I need a very specific example for the use of 'context' in the original distro examples. What are inputs that show a highlighted result ? "XPath Expression:" "XPath Context:" E.g. what input for each field in the form testsuite.php (processing the 'government.xml' file) Whaterver combination I use (just one example) Example (my entries) XPath Expression: //prename XPath Context: /government/person - I get no result highlighted Many thanks, Tom -- This message has been sent through the <phpXML/> user discussion list. To unsubscribe, please visit https://sslsites.de/mailinglisten/user/us...@li.../ |
From: <nig...@us...> - 2001-10-08 14:21:21
|
> Is it possible to count the number of nodes matching a certain > pattern... Call evaluate(), then count the entires in the array of XPath addresses returned. > is it possible to retrieve the contents of a search...like > take a chunk out of the xml data to store in another variable or > object... Currently no, but I think the print_as_xml() function will be expanded in the future to allow you to print part of the xml file. I think someone may have already written this but I don't have the source. > so that you can then get subsets of that in later calls. > Perhaps I could contact you a few times to get started on writing my > first application with your parser so that I can be off and running? Nothing is stopping you from mailing us. There is nothing binding us to answer though ;o) > My second question is, what is the status of development on the > project...are you working on Xpath more or are you beginning to focus on > other aspect of the xml? Yes. It's still very much in development. http://www.sourceforge.net/projects/phpxmldb has the latest version, currently 1.N.4. You'll find change log and outstanding issues there too. You'll also find links to the archive for this list held at www.geocrawler.com Nigel -- This message has been sent through the <phpXML/> user discussion list. To unsubscribe, please visit https://sslsites.de/mailinglisten/user/us...@li.../ |
From: <rot...@ne...> - 2001-10-08 14:19:33
|
How can I get around phpXML's tendency to place tags inside regular text after the tag containing the text. i.e., <blah1> Text<blah2>more</blah2>text. </blah> Comes out Text text.more -- This message has been sent through the <phpXML/> user discussion list. To unsubscribe, please visit https://sslsites.de/mailinglisten/user/us...@li.../ |
From: <nig...@us...> - 2001-10-08 14:17:59
|
> I recently entered the phpXML forum and I would like to know which > projects are there under development that have as base object the phpXML > object. Is anybody working on XSLT? DTD's? Schemas? > I also made some very simple changes to some functions inside the phpXML > object, so now you can use strings to create the XML object and also get a > string representation in order to be able to save it to a DB. If anyone is > interested in the code, just ask for it Welcome to Phpxml :o) Follow the link below, you'll find a version 1.N.5, and an archive with 300 ish messages that have been sent to this list since it's creation. I think you'll be pleased with what you find. Get the version from CVS, not from the download, as 1.N.5 was very buggy... :o( I believe there are at least 3 projects that stem from this work, namely phpxmldb (xml database), a user manager I'm not sure of the project name of, and there's some other project too that is also listed at sourceforge. Do a search for phpxml at sourceforge and you'll find them. Nigel =========================== For the most recent version of phpxml, V1.N.X, and an archive of this list visit: http://www.sourceforge.net/projects/phpxmldb -- This message has been sent through the <phpXML/> user discussion list. To unsubscribe, please visit https://sslsites.de/mailinglisten/user/us...@li.../ |
From: <lu...@sa...> - 2001-10-08 14:16:26
|
Hello, void XML ([string $file]) loads a file. How to process a XML stream coming from another processing ? I need to do something like : $file = 'foo.xml'; $xml_data = $tpl->fetch($file); $xml = new XML($xml_data); But this fails... I don't find in the doc a constructor taking a XML file as a string as argument. Thanks in advance Luc -- This message has been sent through the <phpXML/> user discussion list. To unsubscribe, please visit https://sslsites.de/mailinglisten/user/us...@li.../ |
From: <lu...@sa...> - 2001-10-08 14:14:51
|
Hello, With xml.php to have a correct rendering of HTML enclosed in XML tags (in CDATA sections) the array entities () might be emptied. If it was not the case the HTML entities where converted and then displayed by the browser in their literal form. It seem to be the same with xpath.class.php Im not in front of my development computer so I cant check the xpath.class.php but the result shows that the behavior is the same. Instead of letting the user empty the array containing entities to translate, perhaps it would be a good thing to have a property to set (TRUE or FALSE) depending the behavior we need/want. To go back to my test bed site :-) In the following example both the paragraph displayed in the center of the screen and the contextual menu in the left block came form the same XML file. Here is the xml.php version with entities() emptied : http://www.interpasnet.com/xmlprocess.php? screen=cvs§ion=wincvs&file=cvs.xml&id=1 HTML rendering is OK Here is the xpath.class.php version http://www.interpasnet.com/xmlprocess.xpath.php? screen=cvs§ion=wincvs&file=cvs.xml&id=1 HTML entities contained in CDATA sections are converted so the browser displays them in their literal form Luc -- This message has been sent through the <phpXML/> user discussion list. To unsubscribe, please visit https://sslsites.de/mailinglisten/user/us...@li.../ |
From: <flo...@co...> - 2001-10-08 14:13:17
|
I did some modifications to the phpxml librarie v1.0, as I have discovered a minor bug and missing some feature I needed. For more details see http://www.kzar.net/testxml.php First, now you can do a XPath expression like this one: //document/keyword[contains(text(),'some text')]/parents::* Formerly, this expression did an error as the lib guess that it was a XPtah function like "contains(text()" because of fails inclusive parenthesis detection (sorry for my poor english...) I also added a new method: count_nodes($path) that returns numbers of elements within the path. e.g. you can do: $nodes =3D $xml->count_nodes("/document[$j]/keyword"); for($i=3D1; $i<=3Dnodes; $i++) echo "Keyword =3D ".$xml->get_content("/document[1]/keyword[$i]")."<br>"; This way you don't evaluate a path like that : $test =3D $xml->evaluate("//document[$j]/keyword); foreach($test as $node) echo "Keyword =3D ".$xml->get_content($test)."<br>"; This is usefull and time execution saving as you don't have to evaluate again a path. Any comments and suggestions are welcome. I have a question: is phplib found on the www.phpxml.org site is uptodate? Thank's! Florent Gilles -- This message has been sent through the <phpXML/> user discussion list. To u= nsubscribe, please visit https://sslsites.de/mailinglisten/user/user@lists.= phpxml.org/ |
From: <nig...@us...> - 2001-10-08 14:11:44
|
> > I am relatively new to the XML realm but have some good > > experience with PHP. > > I was wondering if anyone could send a code sample of a simple use of the > > get_file() function used as follows: > > > > 1. Read in XML and write out the contents to a new XML document. I am > > really just look for the behavior of the function. > > 2. Using a form to submit data, formatting that based on a coded template > > in XML string and writing out to file. > > > > If anyone has some code samples of this, I would greatly > > appreciate viewing > > them. > > > > Thank you, > > > > Robby > > If you are new to phpxml, then the very first thing you should do is get V1.N.4 from the below link. Otherwise you'll just end up finding all the bugs we found in the last 3 months. Also phpxmldb will give you examples of quite a lot of the calls, and there's quite good debugging to be found too. V1.0 won't do a very good job of read in and write back out to another XML file, but V1.N.4 will. Nigel =========================== For the most recent version of phpxml, V1.N.X, and an archive of this list visit: http://www.sourceforge.net/projects/phpxmldb -- This message has been sent through the <phpXML/> user discussion list. To unsubscribe, please visit https://sslsites.de/mailinglisten/user/us...@li.../ |
From: <le...@en...> - 2001-10-08 14:10:10
|
It should work with Windows NT too. It doesn't matter. The problem is something else... Dejan ______________________________ Dejan Lekic developer, MySQL DBA, sysadmin http://dl.9mb.net |
From: <le...@en...> - 2001-10-08 14:08:38
|
Finally someone that's sending DIFFs :) Best regards to all! ______________________________ Dejan Lekic developer, MySQL DBA, sysadmin http://dl.9mb.net |
From: <nig...@us...> - 2001-10-08 14:06:53
|
> I'm not sure the problem lies in my XML files, I think it lies in the way I > didn't modify my php file. Didn't think it did. Was trying to recreate the problem on my local machine. > At : http://www.interpasnet.com/1.N.5/examples/government/index.php > You'll find Michael P. Mehl. government example with only two changes : > 1) call to (include) php file xplath.class.php instead of xml.php > 2) call to class XPath instead of XML (like in $xml = new XPath($file);) > > try it with for example the key word "Gerhard" > > The result is the same : > phpXML error: While parsing an XPath expression there was an error in the > predicate "Gerhard", because it was the null string. If you wish to seach > for the empty string, you must use ''. Fails at your site, I go through the same procedure on my own PC and it works. Sounds like either an OS issue, or a implementation issue of PHP. As I can't recreate this error yet, I can't fix it, and it's going to be difficult for me to recreate this one, you might have to try to fix this yourself I'm afraid :o( If anyone has ideas, or experiences the same issue, please let us all know. Nigel -- This message has been sent through the <phpXML/> user discussion list. To unsubscribe, please visit https://sslsites.de/mailinglisten/user/us...@li.../ |
From: <jb....@ca...> - 2001-10-08 14:05:17
|
Hi! I like <phpXml/>. It's a great class, I use it because expat is not installed on my company's web server. Is there a mailing-list, forum, ChangeLog, anything available? The web site lacks information :( I noticed strange things (bugs IMHO): /item[@id=''] does not work because xml.php removes all quotes thus breaking the predicate meaning. /item[@id='03-2001'] does not work because xml.php removes all quotes thus breaking the predicate meaning: left hand expression evaluates to 03-2001 whereas right hand expression evaluates to -1998... Is it easily (self-)fixable? Is it a known issue? TIA -- Jean-Baptiste Quenot -- This message has been sent through the <phpXML/> user discussion list. To unsubscribe, please visit https://sslsites.de/mailinglisten/user/us...@li.../ |
From: <jw...@sh...> - 2001-10-08 14:05:10
|
Hi, Two questions: 1. If I want a node like this: <blah>0</blah>, why it becomes <blah/> ? "0" is definately content imho... 2. I was thinking to use <phpxml/> for creating some kind of cache file between a MySQL databse and a GUI, but now I read deleting nodes is very slow. This worries me. Would it be faster to completely regenerate an XML tree of about 50K from a MySQL database every time than to keep the XML file and delete nodes to keep the cache size limited to 50K? JW -- This message has been sent through the <phpXML/> user discussion list. To unsubscribe, please visit https://sslsites.de/mailinglisten/user/us...@li.../ |
From: <nig...@us...> - 2001-10-08 14:03:35
|
>First, now you can do a XPath expression like this one: > >file://document/keyword[contains(text(),'some text')]/parents::* > >Formerly, this expression did an error as the lib guess that it was a >XPtah function like "contains(text()" because of fails inclusive >parenthesis detection (sorry for my poor english...) I think this bug was fixed in 1.N.4 >I also added a new method: count_nodes($path) that returns numbers of >elements within the path. >e.g. you can do: <snip> >This is usefull and time execution saving as you don't have to evaluate >again a path. Yip. Execution speed is currently crippling this project. Dietrich has done some really interesting work that uses regexes to speed up the evaluate() as opposed to all the horrid recursion that it currently does. I'm currently in discussion with him to see if we can merge the xmltree and phpxml projects so that we can take advantage of the speed increases that he has made. > I have a question: is phplib found on the www.phpxml.org site is > uptodate? No. The one at the http://sourceforge.net/projects/phpxmldb is more uptodate. Nigel -- This message has been sent through the <phpXML/> user discussion list. To unsubscribe, please visit https://sslsites.de/mailinglisten/user/us...@li.../ |
From: <le...@en...> - 2001-10-08 14:02:01
|
Go immediately over http://www.w3.org ______________________________ Dejan Lekic developer, MySQL DBA, sysadmin http://dl.9mb.net |
From: <a.t...@fl...> - 2001-10-08 14:00:29
|
Hi, > : Allowed memory size of 8388608 bytes exhausted (tried to allocate 35 > bytes) in You should change this value in your php.ini file. HTH, Axel Tietje -- FLYnet FLYer Kommunikationsgesellschaft mbH Weender Landstr. 46 37073 Göttingen 0551-499750 http://www.flynet.de a.t...@fl... -- This message has been sent through the <phpXML/> user discussion list. To unsubscribe, please visit https://sslsites.de/mailinglisten/user/us...@li.../ |
From: <yf...@co...> - 2001-10-08 13:58:48
|
Hello, I have the following in an XML file: <title>DTD's & schema</title> Using <phpXML/>, I extract that string using get_content() and display it on a web page. For some reason, the spaces around the ampersand are removed. Does someone have a fix for this? Any help would be really appreciated. Also, there is a bug on line 125: "&apos" should be "'". To make things more troublesome, it looks like Internet Explorer (at least mine!) doesn't recognize ' but will recognize '. Young -- This message has been sent through the <phpXML/> user discussion list. To unsubscribe, please visit https://sslsites.de/mailinglisten/user/us...@li.../ |
From: <nig...@us...> - 2001-10-08 13:57:16
|
> Error is : > phpXML error: While parsing an XPath expression there was an error in the > predicate "1", because it was the null string. If you wish to seach for the > empty string, you must use ''. Try replacing line 1997 with: if (ereg('^[[:space:]]*$', $predicate)) it was: if (ereg('^\w*$', $predicate)) But I'm not sure if \w is trying to match a word, not whitespace. I can't find a useful posix reference, but I know that it should be \s in perl regexes... If you could hone down which evaluate() call makes this error, and perhaps send a small subset of xml and evaluate call that makes the error, then we can add a test to catch this error. As such I haven't been able to reproduce the error, and I'm forbidden to access http://www.interpasnet.com/xml_files/cachecache/cachecache.xml directly. Keep the bug reports rolling, it's looking like a 1.N.6 will be needed very soon... Nigel =========================== For the most recent version of phpxml, V1.N.X, and an archive of this list visit: http://www.sourceforge.net/projects/phpxmldb -- This message has been sent through the <phpXML/> user discussion list. To unsubscribe, please visit https://sslsites.de/mailinglisten/user/us...@li.../ |
From: <sh...@co...> - 2001-10-08 13:55:40
|
Thanks, my question has been answered and I have it working now!! Amy Strycula, Creative Director Coolshopping.com http://www.coolshopping.com http://www.coolshopping.tv (412) 366-7545 voice (412) 366-8528 fax -- This message has been sent through the <phpXML/> user discussion list. To unsubscribe, please visit https://sslsites.de/mailinglisten/user/us...@li.../ |
From: <fra...@vi...> - 2001-10-08 13:55:13
|
DOes somebody know why does when I put a 0 instead of 1 in the XML_OPTION_SKIP_WHITE in the xml_parser_set_option it still skip white? IN the xml.php file? xml_parser_set_option($parser, XML_OPTION_SKIP_WHITE, 0); An other thing why do we need /test[1] shouldn't it be /test? For <test>untest</test> -- Francis Fillion, BAA SI Broadcasting live from his linux box. And the maintainer of http://www.windplanet.com -- This message has been sent through the <phpXML/> user discussion list. To unsubscribe, please visit https://sslsites.de/mailinglisten/user/us...@li.../ |
From: <lu...@sa...> - 2001-10-08 13:52:06
|
Hello Florent, There is a documentation but not really complete as some fucntions have been added since v1.0 Browsing old messages (is there somewhere an archive for the list by the way ??) you'll find some good tips for parsing. regarding doc and examples the problem is more on the editing side.. Luc En réponse à flo...@co...: > Hi! > > Is there any explicit documentation about phpxml, > with some usefull exemples? > > Thank's! -- This message has been sent through the <phpXML/> user discussion list. To unsubscribe, please visit https://sslsites.de/mailinglisten/user/us...@li.../ |
From: <lu...@sa...> - 2001-10-08 13:48:58
|
At 11:39 26/09/01 +0000, lu...@sa... wrote: >Nigel, > >Before releasing 1N6 it would be a Good Thing (tm) to release a 1N5-style >version of original examples (government for example) to avoid the zillions >of question I have about : "how does this new way of Xpath.class.php-ing >work ???" > >Luc Or if you don't have enough time, just tell me what is now the right version of this code that worked with xml.php/1N4 : <buddy_list> <buddy id="1"> <lastname>Doe</lastname> <firstname>John</firstname> <isniceguy>Yes</isniceguy> </buddy> </buddy_list> $myatrributesarray = array(); $listofmybuddies = $xml->evaluate('/buddy_list/buddy'); foreach ( $listofmybuddies as $buddy ) { $myatrributesarray = $xml->get_attributes($buddy); $id = $myatrributesarray['id'] $firstname = $xml->get_attributes($buddy ."/firstname[1]"); $lastname = $xml->get_content($buddy ."/lastname[1]"); $isniceguy = $xml->get_content($buddy ."/isniceguy[1]"); } -- This message has been sent through the <phpXML/> user discussion list. To unsubscribe, please visit https://sslsites.de/mailinglisten/user/us...@li.../ |
From: <lu...@sa...> - 2001-10-08 13:47:24
|
Hello, I second this request, having done part of my site with phpxml using parsing fucntion, I'm now going to do the admin part.. and that's not really easy. Luc En réponse à jan...@im...: > Hi! > > I am looking for an working example of set_content or > other edit xml functions. > Reading/Parsing is no problem - but my script does > not like to edit my xml file :( > > Thanks for help!!! > > Jan -- This message has been sent through the <phpXML/> user discussion list. To unsubscribe, please visit https://sslsites.de/mailinglisten/user/us...@li.../ |