phpxpath-users Mailing List for Php.XPath (Page 19)
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: <ph...@pe...> - 2001-10-08 16:58:45
|
Just thought of a workaround for this: use   instead of a space - e.g. "Tom & Jerry" - 'trim' doesn't realise it's a space, so does nothing with it. Makes the xml file more unreadable, but does the trick. how to fool php . . . On Sunday 08 July 2001 11:46, I wrote: > On Saturday 07 July 2001 20:29, you wrote: > > 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. > > This is because the parser treats entities like & as separate elements > and passes them separately through the character data handler. Because > phpxml trims all strings in its handler, entities also get trimmed. There > is a similar problem with the embedded nodes we've been discussing > (<text>brave <ex>new</ex> world</text>). It needs to do some trimming to > get rid of carriage returns, tabs, etc in the file, but I rather think > instead of getting rid of all of them, it would be better to replace large > amounts of whitespace with one space. Alternatively, only trim spacing at > the beginning and end of nodes, not in the middle. Curiously php has a > (undocumented) SKIP_WHITE option which is used in the parse_into_struct > example, but this doesn't seem to have any effect in the ordinary parse. > > > 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 '. > > solution: don't use IE! (or simply use ' instead) > > -- > This message has been sent through the <phpXML/> user discussion list. To > unsubscribe, please visit > https://sslsites.de/mailinglisten/user/us...@li.../ -- 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 16:53:17
|
> 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. Yeah, I'm not that happy with it as the reason either... > 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" ??? I only know how to use perl regexes, and have still not found a decent POSIX reference despite 1 hour of searching the other day. Run the following script: <?php echo "With 'Gehard'<br>\n"; echo 'result from ereg (using POSIX regexes) is:'.(ereg('^\w$',"Gerhard") ? "true" : "false")."<br>\n"; echo 'result from preg_match (using PERL regexes) is:'.(preg_match("/^\s*$/", "Gerhard") ? "true" : "false")."<br>\n"; echo "With ''<br>\n"; echo 'result from ereg (using POSIX regexes) is:'.(ereg('^\w$',"") ? "true" : "false")."<br>\n"; echo 'result from preg_match (using PERL regexes) is:'.(preg_match("/^\s*$/", "") ? "true" : "false")."<br>\n"; ?> I get an output of: With 'Gehard' result from ereg (using POSIX regexes) is:false result from preg_match (using PERL regexes) is:false With '' result from ereg (using POSIX regexes) is:false result from preg_match (using PERL regexes) is:true Which shows to me that the regex is wrong. So change this line: if (ereg('^\w*$', $predicate)) { to: if (preg_match("/^\s*$/, $predicate)) { And let us all know if it works. Nigel -- 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 16:51:44
|
Hello, Here is the piece of code. // List of entities to be converted. // // This array contains a list of entities to be converted when an XPath // expression is evaluated. // // ### People seem to think that &apos is a bad idea for charset ISO-8859-1 //var $entities = array ( "&" => "&", "<" => "<", ">" => ">", // "'" => "'", '"' => """ ); var $entities = array('&'=>'&', '<'=>'<', '>'=>'>', '"'=>'"'); That means that if I do [....]<!CDATA[[<p>Hello world</p>]]>[...] The rendering will be <p>Hello world</p> And the browser will display <p>Hello world</p> The easiest (but probably not the safiest) solution is to emplty $entities, I have no problem with that because until now I use xml.php/xpath.class.php to read XML files not to produce XML files, but I suppose that emptying $entities is a bad thing to do when it comes to output XML. Luc En réponse à lu...@sa...: > 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.../ > -- 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 16:48:36
|
> I have the following code: > > $cats = $xml->evaluate("//SCAN/IP[@value=".$ip_ip."]/VULNS[1]/CAT"); > > foreach ($cats as $cat) > > > $cat_atts = $xml->get_attributes($cat); > $vuln_cat = $cat_atts["value"]; > $vuln_port = $cat_atts["port"]; > > > $vulns = > $xml->evaluate("//SCAN/IP[@value=".$ip_ip."]/VULNS[1]/CAT[@value=".$vuln_cat > ."]/VULN"); > > foreach ($vulns as $vuln) > { ...................... > > > On the first pass thru $cat I get only the $vulns for that $cat, however on > the second $cat I get the $vulns for the first and second $cat as can be > seen below. > > <snip> > /SCAN[1]/IP[1]/VULNS[1]/CAT[1] > /SCAN[1]/IP[1]/VULNS[1]/CAT[1]/VULN[1] > /SCAN[1]/IP[1]/VULNS[1]/CAT[1]/VULN[2] > /SCAN[1]/IP[1]/VULNS[1]/CAT[1]/VULN[3] > /SCAN[1]/IP[1]/VULNS[1]/CAT[1]/VULN[4] > /SCAN[1]/IP[1]/VULNS[1]/CAT[1]/VULN[5] > /SCAN[1]/IP[1]/VULNS[1]/CAT[1]/VULN[6] > /SCAN[1]/IP[1]/VULNS[1]/CAT[2] > /SCAN[1]/IP[1]/VULNS[1]/CAT[1]/VULN[1] > /SCAN[1]/IP[1]/VULNS[1]/CAT[1]/VULN[2] > /SCAN[1]/IP[1]/VULNS[1]/CAT[1]/VULN[3] > /SCAN[1]/IP[1]/VULNS[1]/CAT[1]/VULN[4] > /SCAN[1]/IP[1]/VULNS[1]/CAT[1]/VULN[5] > /SCAN[1]/IP[1]/VULNS[1]/CAT[1]/VULN[6] > /SCAN[1]/IP[1]/VULNS[1]/CAT[2]/VULN[1] > /SCAN[1]/IP[1]/VULNS[1]/CAT[2]/VULN[2] > /SCAN[1]/IP[1]/VULNS[1]/CAT[2]/VULN[3] > /SCAN[1]/IP[1]/VULNS[1]/CAT[2]/VULN[4] > > Is this the way its supposed to work and any suggestions on how to get > around this would be greatly appreciated. I don't think that this is how it is meant to work. It's possible you've a coding error, perhaps something like a value of $cat_atts["value"] that is '*' or something, but more likely a bug. I'd suggest downloading version 1.N.4 and switching on the debug flags in the evaluate functions to get a "stack trace". This might help isolate the problem and determine if it is a bug or a coding error. If you are still stuck perhaps sending us a portion of the xml and the complete php file might allow us to reproduce the error ourselves? The evaluate() function has several known problems, and sadly it wouldn't be all that surprising if there were some more. Version 1.N.5 is going to have a complete re-write of the evaluate() function that should give us MUCH better performance. 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: <nig...@us...> - 2001-10-08 16:47:02
|
> BTW, did anyone check the code before releasing it? > How else could one miss those bugs like the > "$this ->" thing and the setAttributes-function, > that did not work at all. This is a completely valid complaint, and I think I should explain the "histroy" of the 1.N.5 release a bit more to you. There were some major changes to phpxml, and I was keen to get them to you. On the other hand given bugs like the <a>1<b>2</b>3</a> which make me extremely worried about the integrity of the code that modifies the xml object. Testing up until 1.N.5 has been non existant, so there have been no unit tests to run in order to check that we have a "consistent" release. I decided that I would ship the 1.N.5 changes incompletely tested in the vain hope that there weren't any bugs. You don't have to use it, hence 1.N.4 is still available for download. I'm extremely sad to here of "stupid" mistakes like missing out "$this->" ans so forth, and this embarrasses me and only further highlights the need for unit tests. The xPathQuerys.php unit test distributed with 1.N.5 is designed to test the XPath element of phpxml. It has shown up some bugs, and they have been fixed. Sadly we seem to have found some other bugs now so we will adapt the unit test to expose the bugs, then fix them. Then this bug will NEVER appear in any further release of phpxml. The other area of unit tests that is required is in the xml modification and content access area. This is one of the major advantages in changing to a DOM style public interface. DOM is well understood, and test data exists that we can use for phpxml to give us a unit test. http://www.w3.org/DOM/Test/. The next major step I have planned for development, before more performance enhancements, is to build a DomTest.php unit test for phpxml, that will test to check that we modify xml documents correctly. So in the mean time I'm afraid you guys are the major testing element of phpxml, and all the bugs you supply me with I will fix ASAP and will re-release. I will not expire the old interface unit you can all seamlessly change to using the latest version, then upgrade to the DOM interface in your own time. I plan to release 1.N.6 this weekend with all the bugs that have been reported this week. Thanks for your patience thus far, and please keep the bug reports rolling in, Nigel -- 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 16:43:55
|
Daniel, This is much more efficient FM ;-) Thanks a lot by the way fore some reason $sorties =3D $xml->evaluate('//agenda/month[@name=3D"%s"]', $month_name); give an empty array while $sorties =3D $xml->evaluate('//agenda/month[@name=3D'.$month_name.']'); works OK Thanks again Luc At 07:19 07/07/01 +0000, inf...@aj... wrote: >Bonjour luc, > >Le samedi 7 juillet 2001 =E0 09:10:32, vous =E9criviez : > >lsec> '//agenda/month[@name=3D"$month_name"]'); > >It's not phpXml but an error with your PHP coding : >Between single quotes PHP doesn't calculate/evaluate the variables if >you make this test : >$month_name =3D 18; >echo '//agenda/month[@name=3D"$month_name"]'; > >You will obtain this output : //agenda/month[@name=3D"$month_name"] > >To correct you must write : >echo "//agenda/month[@name=3D\"$month_name\"]"; >and you will have : //agenda/month[@name=3D"18"] > >I prefer this : >echo sprintf( '//agenda/month[@name=3D"%s"]', $month_name) ; > >I use echo to demonstrate, you use this in strings.. >(Sorry but my english is poor, I hope I help you) >-- >Cordialement, > Daniel mailto:inf...@aj... >---------- >Support-Assistance PHP/MySql de =ABInternet Pour Tous=BB >http://www.i-p-t.com.fr/ :::XML/XSLT - Sablotron::: -- 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 16:40:48
|
Tom I read the FM several times ;-)) I tried if ( !empty($month_name) ) { $sorties = $xml->evaluate('//agenda/month[@name="$month_name"]'); } else { $sorties = $xml->evaluate('//agenda/month'); } If I use this I get a phpXML error: While parsing the XPath expression "$month_name" an empty and therefore invalid node-test has been found. The FM doesn't say what does "an empty and therefore invalid node-test has been found" mean in plain english ;-)) Luc At 23:26 06/07/01 +0000, tom...@di... wrote: >As is described (aka RTFM ;-) in the ZVON tutorial >http://www.zvon.org/xxl/XPathTutorial/General/examples.html > > > //month[@name='January'] > > >At 11:09 PM 7/6/01 +0000, lu...@sa... wrote: > >><agenda> >> <month name="January"> >> <event> >> <date/> >> <location> >> <name/> >> <address/> >> <town/> >> <country/> >> </location> >> <phone/> >> <email/> >> <web/> >> <description/> >> </event> >> </month> >> >>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: <o.t...@ab...> - 2001-10-08 16:39:13
|
Hi, Can anybody tell me how to use the xml.php file. Do I have to place it on a certain location, or do I have to include that in every file? Thanks, Oliver Talens **************************************************************** Abyss I.T. Solutions Mathildastraat 36B 4901 HC Oosterhout http://www.Abyss.nl http://www.PanelPoint.nl tel: +31 (0)162-439809 fax: +31 (0)162-439882 O.T...@Ab... **************************************************************** -- This message has been sent through the <phpXML/> user discussion list. To unsubscribe, please visit https://sslsites.de/mailinglisten/user/us...@li.../ |
From: <d_o...@we...> - 2001-10-08 16:37:39
|
Hi everyone, i sent this letter to mp...@ph... but all I got was an auto-reply. So pls read my mail, and if anyone's interested, contact me. Bye David Oswald <--Letter--> Hello, my name is David Oswald, I'm a 16 years old student and come from Essen, Germany. I've been working with PHP/MySQL for about one year. A few weeks ago, I began to learn Java (which is great) and since then, I think about an object-oriented framework for PHP. As you probably know, the support for objects in PHP is more or less rudimentary: No destructor, no framework with base classes etc.. That's why I plan to make a Java-like framework for PHP. I know that there are already a few libraries (e.g. PEAR), but I think that these are too complex and a bit inconsistent. For example, lots of PEAR extensions do not inherit the base class and moreover, there aren't any more specific classes like Document, Client etc.. So I decided to program my own framework. Moreover, I want to create a website for it and other tools & scripts written in next generation languages like Java, .... Ah, and it should of course be free, e.g. distributed under the GPL or MPL. After a long search (I never imagined that there are so many companies with the word "dawn" in their names ;-)), I chose the french expression "Point du Jour" (dawn) as a title for that project. I want that project to be something like a dawn for webmasters, internet programmers etc.. Now you ask: Why did you send me this mail? What do you expect me to do? Well, you offer the PHP-script "phpxml". I can't program a whole framework and I think that your script would be important for my project. So I want you to ask whether you would contribute something to "Point du Jour" and integrate your program or at least allow that someone else integrates your tool into the framework. There's a lot of work and I already "only" wrote a base class called "Object" with destructor emulation, an "Error"-class and a simple Java-based HTML-Editor. But I want to make the project become bigger and so it would be really great if you support me. If you are interested in helping me with "Point du Jour" and therefore want to get more information, pls mail back. Any kind of support, e.g. programming, translation, documentation,... is welcome. Thx in advance Yours David. David Oswald Essen, Germany d_o...@we... <--/Letter--> -- 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 16:36:06
|
Hello, attributes are in an array() try : $t = array(); $list_imentenoticias = $xml->evaluate('/imentenoticias'); foreach ( $list_imentenoticias as $imentenoticia ) { $t = $xml->get_attributes($imentenoticia); $id =$t['id'] $url = $xml->get_content($imentenoticia ."/url[1]"); $titular_texto = $xml->get_content($imentenoticia ."/titular_texto[1]"); $media = $xml->get_content($imentenoticia ."/media[1]"); $url_fuente = $xml->get_content($imentenoticia ."/url_fuente[1]"); and so on.... } Luc En réponse à fca...@la...: > Hello everybody, I'm a beginner working with xml, and I have a little > problem extracting the data. > I have an estructure like this > <?xml version="1.0" encoding="iso-8859-1"?><!DOCTYPE imentenoticias > SYSTEM > "http://imente.com/xml/dtd/imentenoticias.dtd"> > <imentenoticias> > <article id="1000279706996255072"> > > <url>http://www.imente.com/ver/not.cgi?1000279706996255072</url> > <titular_texto>Cientificos Apoyan Celulas Madre Y Creen No > Suficiente Plan Bush</titular_texto> > <fuente>NAVEGALIA.COM Noticias - Sociedad</fuente> > <media>text</media> > > <url_fuente>http://www.navegalia.com/Channels/Noticias/Secciones/layout_Secc > ion/0,18600,sociedad,00.html</url_fuente> > <fecha_captura>Mie 12 Set 2001 09:28</fecha_captura> > <indexacion></indexacion> > </article> > </imentenoticias> > > and i want to select everything including the id. I could select > everything > but how can i take the id? > i have tried > $xml = new XML("exemple.xml"); > // Select all members of the government. > $imentenoticias = $xml->evaluate("//@id"); > // Run through all members of the government. > foreach ( $imentenoticias as $noticia ) > { > // Retrieve information about the person. > $id = $xml->get_content("//@id[1]"); > $id2 = $xml->get_content($noticia."/id[1]"); > } > > and I obtain empty values. > > thank you > best regards > Fernando Caamaño > > -- > This message has been sent through the <phpXML/> user discussion list. > To unsubscribe, please visit > https://sslsites.de/mailinglisten/user/us...@li.../ > -- 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 16:34:30
|
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)? Thanks Amy Strycula, Creative Director Coolshopping.com http://www.coolshopping.com http://www.coolshopping.tv (412) 366-7545 voice (412) 366-8528 fax -----Original Message----- From: lu...@sa... [mailto:lu...@sa...] Sent: Monday, July 23, 2001 1:11 AM To: us...@li... Subject: [phpXML] Re: phpxml Version 1.N.4 Hello, Sorry if my question is stupid.. is this a fork ??? Luc At 23:55 22/07/01 +0000, Ni...@Sw... wrote: >Spotted a major blunder in 1.N.3. Well only major if you are using >operators in your XPath searches. They all end up getting evaluated as mod >as I missed the break statements from the switch block. This means you >often get div/0 errors as false is interpreted as 0. > >Oops. Sorry :o) > >Also made what I think is quite an important optimisation to some of the >evaluate() private functions so that searches with fully qualified node >positions will take 3 less function calls than they were. > >http://sourceforge.net/projects/phpxmldb/ > >Nigel -- This message has been sent through the <phpXML/> user discussion list. To unsubscribe, please visit https://sslsites.de/mailinglisten/user/us...@li.../ -- This message has been sent through the <phpXML/> user discussion list. To unsubscribe, please visit https://sslsites.de/mailinglisten/user/us...@li.../ |
From: <an...@is...> - 2001-10-08 16:34:16
|
Eh, no, because that just gives me back "/publication/foo1[1]", "/publication/foo2[1]" and so on. I just want the array of "foo1", "foo2" returned. On Wed, 18 Jul 2001, Ni...@Sw... wrote: > /Publication/* > ----- Original Message ----- > From: <an...@is...> > To: <us...@li...> > Sent: Wednesday, July 18, 2001 5:32 PM > Subject: [phpXML] Help with XPath expression > > > > What kind of XPath expression can I use to select the names of all the > > child nodes? That is, given the following fragment: > > > > <publication> > > <foo1> > > .. > > </foo1> > > <foo2> > > .. > > </foo2> > > .. > > </publication> > > > > I want to get the names of all nodes under <publication>. > > > > Thanks, > > > > -Andrei > > * How would this sentence be different if Pi was equal to three? * > > > > -- > > This message has been sent through the <phpXML/> user discussion list. To unsubscribe, please visit https://sslsites.de/mailinglisten/user/us...@li.../ > > > > > -- > This message has been sent through the <phpXML/> user discussion list. To unsubscribe, please visit https://sslsites.de/mailinglisten/user/us...@li.../ -Andrei The 3 great virtues of a programmer: Laziness, Impatience, and Hubris. --Larry Wall -- This message has been sent through the <phpXML/> user discussion list. To unsubscribe, please visit https://sslsites.de/mailinglisten/user/us...@li.../ |
From: <inf...@aj...> - 2001-10-08 16:32:40
|
Bonjour infonews, Le samedi 7 juillet 2001 à 10:05:54, vous écriviez : iac> Bonjour luc, iac> Le samedi 7 juillet 2001 à 09:59:31, vous écriviez : lsec>> $sorties = $xml->evaluate('//agenda/month[@name="%s"]', $month_name); iac> No write this : iac> $sorties = $xml->evaluate( sprintf( '//agenda/month[@name="%s"]'), $month_name); Sorry, I always have this in the reply address : us...@li..., us...@li..., us...@li..., us...@li..., us...@li..., us...@li..., us...@li..., us...@li..., us...@li..., us...@li..., us...@li..., us...@li..., us...@li..., us...@li..., us...@li..., us...@li..., us...@li... Sometimes i take care, another no ;-( I have modified my mailer to override the adress when reply ! -- Cordialement, Daniel mailto:inf...@aj... ---------- Support-Assistance PHP/MySql de «Internet Pour Tous» http://www.i-p-t.com.fr/ :::XML/XSLT - Sablotron::: -- -- This message has been sent through the <phpXML/> user discussion list. To unsubscribe, please visit https://sslsites.de/mailinglisten/user/us...@li.../ |
From: <ph...@pe...> - 2001-10-08 16:31:03
|
On Wednesday 04 July 2001 22:01, you wrote: > I was initially thrown off by the 'trivialness' of the example but when I > look at how you intend to process the file it seems to cry out for a > different structure altogether. > > Is it not true that _if_ there are children _then_ the children should > stand as elements of the parent? ((then the other 'content' is/are really > attributes of the parent)) > > That would say to me that the example being discussed could (should?) > better be constructed like > > <blah1 precursor="Text" postcursor="text."> > <blah2>more</blah2> > </blah> > > Wouldn't that be more parallel to the processing that you intend to do to > the file? > > my 2cents > Tom the whole point of xml/xsl/etc is that it separates content from processing. One xml file can be processed in any number of different ways. If a processor, whether it be phpxml or anything else, can only handle files in a certain format, then it is of limited use. A general-purpose xml evaluator like phpxml _must_ be able to handle any valid xml file. If you want a non-trivial example, download any of the xml or xhtml TRs from W3C, then use Michael's nice little XPath Testing Environment script to evaluate it. You will soon see what the problem is. If you now tell the folk at W3C they should rewrite their documents so phpxml can handle them, I doubt whether you'll get a printable reply! -- This message has been sent through the <phpXML/> user discussion list. To unsubscribe, please visit https://sslsites.de/mailinglisten/user/us...@li.../ |
From: <ph...@pe...> - 2001-10-08 16:26:06
|
On Saturday 07 July 2001 20:29, you wrote: > 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. This is because the parser treats entities like & as separate elements and passes them separately through the character data handler. Because phpxml trims all strings in its handler, entities also get trimmed. There is a similar problem with the embedded nodes we've been discussing (<text>brave <ex>new</ex> world</text>). It needs to do some trimming to get rid of carriage returns, tabs, etc in the file, but I rather think instead of getting rid of all of them, it would be better to replace large amounts of whitespace with one space. Alternatively, only trim spacing at the beginning and end of nodes, not in the middle. Curiously php has a (undocumented) SKIP_WHITE option which is used in the parse_into_struct example, but this doesn't seem to have any effect in the ordinary parse. > 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 '. solution: don't use IE! (or simply use ' instead) -- 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 16:23:02
|
One thing I would do to start is use include(path_to_xml.php); instead of require. Young At 03:38 PM 7/11/2001 +0000, you wrote: >I tried to use the phpxml package (latest version on http://www.phpxml.org/) >but i encountered errors when running the included example files. >Even a very simple test i made generated an error : > ><? > require getenv('DOCUMENT_ROOT') . '/../common/xml.php'; > $doc = new XML('base.xml'); > echo $doc->get_file(); >?> > >The base.xml document contains only this : ><?xml version="1.0" encoding="iso-8859-1"?> ><test> ></test> > >I expected this to just display this simple XML document, but instead it >generated errors : ><br> ><b>Warning</b>: Undefined index: /test in <b>/www/wine/common/xml.php</b> >on line <b>443</b><br> ><br> ><b>Warning</b>: Undefined index: in <b>/www/wine/common/xml.php</b> on >line <b>456</b><br> ><br> ><b>Warning</b>: Undefined index: in <b>/www/wine/common/xml.php</b> on >line <b>464</b><br> ><test/> > >All examples in the package (governement, xpath) generated simular problems. >What am i doing wrong ?.. > >Pieter Bosteels >i-Merge > > >-- >This message has been sent through the <phpXML/> user discussion list. To >unsubscribe, please visit >https://sslsites.de/mailinglisten/user/us...@li.../ -- This message has been sent through the <phpXML/> user discussion list. To unsubscribe, please visit https://sslsites.de/mailinglisten/user/us...@li.../ |
From: <sd...@ga...> - 2001-10-08 16:21:26
|
I posted a note about this a while back and got a response but have lost it. I've got a little more insight now. I have the following code: ---------------------------------------------------------------------------- -------------------- $cats = $xml->evaluate("//SCAN/IP[@value=".$ip_ip."]/VULNS[1]/CAT"); foreach ($cats as $cat) { $cat_atts = $xml->get_attributes($cat); $vuln_cat = $cat_atts["value"]; $vuln_port = $cat_atts["port"]; echo $cat." ".$vuln_cat."<BR>"; $vulns = $xml->evaluate("//SCAN/IP[@value=".$ip_ip."]/VULNS[1]/CAT[@value=".$vuln_cat ."]/VULN"); foreach ($vulns as $vuln) { echo $vuln."<BR>"; $vuln_atts = $xml->get_attributes($vuln); $vuln_sev = $vuln_atts["severity"]; ---------------------------------------------------------------------------- ------------------------------------- When the loop gets to the last $cat, it picks up the $vulns from all of the previous $cats as well as the last one. This can be seen in the following diagnostic print out. There are no * or other special characters involved. Is this a bug or am I missing something. It only seems to happen on the last group. /SCAN[1]/IP[1]/VULNS[1]/CAT[1] dns /SCAN[1]/IP[1]/VULNS[1]/CAT[1]/VULN[1] /SCAN[1]/IP[1]/VULNS[1]/CAT[1]/VULN[2] /SCAN[1]/IP[1]/VULNS[1]/CAT[1]/VULN[3] /SCAN[1]/IP[1]/VULNS[1]/CAT[1]/VULN[4] /SCAN[1]/IP[1]/VULNS[1]/CAT[1]/VULN[5] /SCAN[1]/IP[1]/VULNS[1]/CAT[1]/VULN[6] /SCAN[1]/IP[1]/VULNS[1]/CAT[1]/VULN[7] /SCAN[1]/IP[1]/VULNS[1]/CAT[2] identd /SCAN[1]/IP[1]/VULNS[1]/CAT[2]/VULN[1] /SCAN[1]/IP[1]/VULNS[1]/CAT[3] tcp-ip /SCAN[1]/IP[1]/VULNS[1]/CAT[1]/VULN[1] /SCAN[1]/IP[1]/VULNS[1]/CAT[1]/VULN[2] /SCAN[1]/IP[1]/VULNS[1]/CAT[1]/VULN[3] /SCAN[1]/IP[1]/VULNS[1]/CAT[1]/VULN[4] /SCAN[1]/IP[1]/VULNS[1]/CAT[1]/VULN[5] /SCAN[1]/IP[1]/VULNS[1]/CAT[1]/VULN[6] /SCAN[1]/IP[1]/VULNS[1]/CAT[1]/VULN[7] /SCAN[1]/IP[1]/VULNS[1]/CAT[2]/VULN[1] /SCAN[1]/IP[1]/VULNS[1]/CAT[3]/VULN[1] /SCAN[1]/IP[1]/VULNS[1]/CAT[3]/VULN[2] /SCAN[1]/IP[1]/VULNS[1]/CAT[3]/VULN[3] /SCAN[1]/IP[1]/VULNS[1]/CAT[3]/VULN[4] Steve Dowell -- This message has been sent through the <phpXML/> user discussion list. To unsubscribe, please visit https://sslsites.de/mailinglisten/user/us...@li.../ |
From: <ph...@pe...> - 2001-10-08 16:19:51
|
On Friday 06 July 2001 17:30, you wrote: > I'm using phpXML to export/import object heirarchies in an application > server. I haven't run into the memory limit yet, but when the application > server starts getting some real use people may want to back up an entire > site. > > I'm thinking of creating an extension of phpXML that stores node content in > a temporary file instead of keeping it in memory. The method > set_external_content() will write to a file pointer and then set some node > attributes like ext_ctnt_position and ext_ctnt_length. The method > get_external_content() will use those attributes to seek to that position > in the file and grab the specified content. > > Any thoughts on this? Pitfalls? Interest? obvious disadvantage for one-off use is that it would be much slower. If this were reasonably static data, you could store the result in a permanent file as a sort of Xpath index, and then use that in your scripts - I quite like that idea, especially as other users could then use the index instead of rereading the file every time. xml files are no different from any other flatfile 'database': reading an entire large file to extract a small amount of data is not a very efficient thing to do. Without knowing your application, I would say as a rule of thumb, if xml files start getting large, either move to dbms with proper indexing or find some way to split into smaller files. -- This message has been sent through the <phpXML/> user discussion list. To unsubscribe, please visit https://sslsites.de/mailinglisten/user/us...@li.../ |
From: <te...@ho...> - 2001-10-08 16:18:16
|
nice move andrei :))) ----- Original Message ----- From: <an...@is...> To: <us...@li...> Sent: Wednesday, July 18, 2001 9:11 AM Subject: [phpXML] Re: Help with XPath expression > On Wed, 18 Jul 2001, Ni...@Sw... wrote: > > So write one :o) > > > > Mail it round we all get to use it. I'll encorporate it into my > > version too so that when I mail round 1.N.3 it'll have that in it too. > > > > Welcome to Open Source. It's not a license to sit back and be lazy, > > it's an oppertunity to benefit from others hard work and to share your > > own. > > No need to preach, I'm well aware of what Open Source is. ;-) > > http://www.zend.com/comm_person.php?id=24 > > -Andrei > > -- > This message has been sent through the <phpXML/> user discussion list. To unsubscribe, please visit https://sslsites.de/mailinglisten/user/us...@li.../ -- This message has been sent through the <phpXML/> user discussion list. To unsubscribe, please visit https://sslsites.de/mailinglisten/user/us...@li.../ |
From: <te...@ho...> - 2001-10-08 16:16:35
|
i was in such trouble too. i wonderfully read XML but adding nodes couse a problem.. i tryed everything. may be somebody will write simply examples how to add/remove/modify nodes and write it back to file ----- Original Message ----- From: <ga...@wh...> To: <us...@li...> Sent: Monday, July 09, 2001 8:45 AM Subject: [phpXML] Problems using element[@attribute=''] syntax ?? > Hi, > > I can't, for the life of me, get the following working: > > $newNode = > $calendarXML->add_node("/calendar[1]/month[normalize-space(@number)='01']/da > y[normalize-space(@number)='02']","entry"); > $calendarXML->add_content($newNode,"something"); > > I've checked my syntax and it appears to be fine but no matter what I do it > won't add the node in. Does anybody have any ideas? I was hoping to use this > method to help me to handle a calendar system quicker. > > Regards, > > Gareth > > > > -- > This message has been sent through the <phpXML/> user discussion list. To unsubscribe, please visit https://sslsites.de/mailinglisten/user/us...@li.../ -- 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 16:13:26
|
Hello, $contents = $xml->evaluate('/root'); foreach ($contents as content) { $myitem = $xml->get_content($content."/item[1]"); .... } At 06:49 15/07/01 +0000, you wrote: >Hello all, > >I'm new to using the phpxml script and I can't seem to >get a basic example using the get_content() function to work. > >I was wondering if someone might be willing to point me in the right >direction here. I feel as though I'd be on my way if I could only >understand why such a simple example won't work. > >I've included the two files below (test.php and test.xml) >Any help would be very much appreciated. > >Thanks in advance for your time, > >John Vollmer > > >******test.php********** ><?php //include the phpxml class include("xml.php"); // bring in the xml >$xml = new XML("test.xml"); //get content of the item element $content = >$xml->get_content("/root/item"); //print the node's content echo "Content: >".$content; ?> > >*********test.xml*********** ><?xml version="1.0"?> ><root> > <item>content</item> ></root> > > >-- >This message has been sent through the <phpXML/> user discussion list. To >unsubscribe, please visit >https://sslsites.de/mailinglisten/user/us...@li.../ -- 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 16:11:50
|
> Is there a mailing-list, forum, ChangeLog, anything available? The web > site lacks information :( No forum. I'm working on an archive for this list. I'll let you know when I've got it fixed and up and running. It will include all the last 166 messages posted to this list since it's creation. Version 1.N.X has a change log and a known bug list for 1.N.X releases. > 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? Sadly the issue about the "-" isn't related to the quotes. The predicate code looks for operators, and splits when it finds one so it splits this into @id'03 - 2001'. This is a known high priority bug. You are right about the quotes though, version 1.0 does bin them all. Are you using version 1.0 or version 1.N.4? I think this issue was dealt with in one of the 1.N.X versions. Check out http://sourceforge.net/projects/phpxmldb Nigel. -- This message has been sent through the <phpXML/> user discussion list. To unsubscribe, please visit https://sslsites.de/mailinglisten/user/us...@li.../ |
From: <pb...@we...> - 2001-10-08 16:10:16
|
Hi Tilo, auch wenn das leicht offtopic ist.... Mach doch mal ein <?php print_r($HTTP_POST_VARS); print_r($HTTP_GET_VARS); ?> Das gibt dir alle Variablen aus, die per POST oder GET gesetzt wurden. Nur daruber konnte IMHO Flash die XML-Daten ja ubertragen. Sehr hilfreich ist auch immer ein <?php phpinfo(); ?>. Gru?e Philipp. PS: Diese ist eigentlich eine englische Mailingliste, also in Zukunft bitte auf Englisch schreiben. > -----Ursprungliche Nachricht----- > Von: ti...@sc... [mailto:ti...@sc...] > Gesendet: Donnerstag, 16. August 2001 11:42 > An: us...@li... > Betreff: [phpXML] xml vs. flash vs. php > > > Tag Michael Mehl, > > Ich habe leider ein Problem mit PHP und XML, ware schon wenn > Du vielleicht > eine Idee hattest. Folgendes: > > 1. Ich versende von einem Flashfilm ein XML im Hilfe der > POST-Methode an > eine PHP Datei. > > 2. Nun ist es ja recht einfach ein <input> tag von einer HTML > Seite als > Variable im PHP wiederzufinden. > > 3. Leider kann ich mein XML Tag nicht wie ein <input> Tag im > PHP auswerten. > > Folgende Versuche die XML Attribute <beispiel frage="XML" > name="Hans" /> > viel eine HTML und PHP zu behandeln, also $beispiel, $frage > oder $name, > blieben erfolglos. > > Mein Problem liegt also in der Auswertung - ich Weis leider > nicht Wie und > Wonach ich im Script fragen mu?, um mein XML finden zu konnen. > > Es geht mir nicht um die Auswertung des XML's!! Alle bisherigen > Beschreibungen von XML Interpretationen gehen davon aus, da? > das XML als > File vorliegt und mit fopen() eingelesen werden konnen. > > Also wenn Dir vielleicht hierzu etwas einfallt ware es schon > wenn Du mir > eine Antwort senden konntest. > > Vielen Dank > > Tilo Erwin > > > -- > This message has been sent through the <phpXML/> user > discussion list. To unsubscribe, please visit https://sslsites.de/mailinglisten/user/us...@li.../ -- 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 16:08:41
|
Hello, Sorry guys its time to fire the my_stupid_question_of_the_day() function : In the government example, the search function is pretty simple because the search is done on content if ( !empty($term) ) { // Only select those persons, in whose name or position // the search string is present. $government = $xml->evaluate( "//person/*[contains(., $term)]/.."); } else { // Select all members of the government. $government = $xml->evaluate("//person"); } How would one (one = me) proceed to do the same kind of thing with a search based on attributes especially as attributes aren't accessed directly but through an array In fact I've a file that is an agenda and I'd like to be able to search on the attribute month "name" : <agenda> <month name="January"> <event> <date/> <location> <name/> <address/> <town/> <country/> </location> <phone/> <email/> <web/> <description/> </event> </month> 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: <ga...@wh...> - 2001-10-08 16:07:05
|
Hi, I've just come across a bug. In my XML I have something like the following: <addressbook> <entry> <id>3838949</id> <name> <firstname>A</firstname> <middlenames>Jon</middlenames> <lastname>Somebody</lastname> </name> </entry> <entry> <id>23523455</id> <name> <firstname>B</firstname> <middlenames>Paul</middlenames> <lastname>Somebody</lastname> </name> </entry> <entry> <id>23523455</id> <name> <firstname>Jon</firstname> <middlenames>Smith</middlenames> <lastname>Somebody</lastname> </name> </entry> </addressbook> Each <entry> has a number of other elements (about 20 in total). Anyway, when I remove one and add a new one the resulting output from phpXML is wrong. The removed <entry> is indeed gone, the added <entry> isn't there and there's a </> element (which is incorrect). The only way I found round this is to remove the <entry>, output the XML, then create a new XML document with it and then add the new <element>. This seems to be a fairly major bug in phpXML - any ideas on how to resolve this? Regards, Gareth Lancaster -- This message has been sent through the <phpXML/> user discussion list. To unsubscribe, please visit https://sslsites.de/mailinglisten/user/us...@li.../ |