Thread: Use XPTAH v3.0 with W98
Brought to you by:
bs_php,
nigelswinson
From: Pozzer F. <fra...@in...> - 2002-05-29 08:53:13
|
> Thanks for all. I hope to explain well my problem. > I have to make same little code PHP to use XPtah for to understand > how work it in the XML structure. > > I have two ENV where I try XPath: WinNT and W98. I describe it: > > 1. WinNT Server PII AcerPower4100; 250Mhrz; 132MB of RAM > In this ENV I have Apache 1.3.24 from the apache.org and PHP 4.2.1 from > php.net. > I do not use tools for Windows system like PHPTRIAD (www.phpgeek.com) > > In this ENV XPTAH work fine and the performance are enough good ( I > compare it with DOM API Class from this site > http://devil.medialab.at/projects/phpdom/doc/phpDOM_Demo.html). > > In this ENV not problems, > now................................................. > > 2. W98 P133 Unisys 32MB of RAM . > Also in this ENV I have Apache 1.3.24 from the apache.org and PHP 4.2.1 > from php.net and I do not use any Windows tools for Apache and PHP. > > In this ENV the same sample and code PHP that work fine in the WinNT ENV > do not work. > > The error that I have it is this: > > XPath error in Xpath.class.php:1333 In importFromFile(): > The url 'http://localhost/FEDRAXPATH/SV/PHP/XML/Elenco_Pratiche.xml' > could not be found or read. > > Warning: Invalid argument supplied for foreach() in > C:\Programmi\Apache > Group\Apache\htdocs\FEDRAXPATH\SV\PHP\CLASSUTILITY\mieProve\Xpath.class.php > on line 1860 > > XPath error in Xpath.class.php:4224 The supplied xPath-query > '/Elenco_Pratiche[1]' does not match *any* node in the xml document. > > XPath error in Xpath.class.php:966 Couldn't get an exclusive lock on the > c:/programmi/apache > group/apache/htdocs/FEDRAXPATH/SV/PHP/XML/Elenco_Pratiche.xml file. > > Before to close my msg I have see a very strangeness. > > At the start the XML file Elenco_Pratiche.XML it is like this: > > <?xml version="1.0" ?> > <Elenco_Pratiche> > <RECORD> > <Cod_Pratica>null</Cod_Pratica> > <Mod_Base>null</Mod_Base> > <Denominazione>null</Denominazione> > <Ultimo_Agg>null</Ultimo_Agg> > <Ultimo_Scar>null</Ultimo_Scar> > <Tipo_Scar>null</Tipo_Scar> > </RECORD> > </Elenco_Pratiche> > > I want to clone this NODE and CHILD with the field and with there value of > the HTML page generated by PHP code. > > After to execute my code PHP and when I have a error the file XML > Elenco_Pratiche.xml are empty > > Thanks all for response. I like if the Fiends of the NG write me also > directly. Thanks. > > Ciao e grazie. Franco www.infocamere.it fra...@in... > > > |
From: Peter R. <php...@pe...> - 2002-05-29 17:29:53
|
it looks like you're trying to read a local file with a url which it can't find. All the other errors are coming because of that. 1. does this url actually exist? :-) (can you view it in your browser?) 2. is allow_url_fopen on? it generally is, but you never know . . . 3. if all you are doing is reading local files, it would be much better/faster to read from local filesystem rather than using http On Wednesday 29 May 2002 10:00, Pozzer Franco wrote: > > Thanks for all. I hope to explain well my problem. > > > > I have to make same little code PHP to use XPtah for to > > understand how work it in the XML structure. > > > > I have two ENV where I try XPath: WinNT and W98. I describe it: > > > > 1. WinNT Server PII AcerPower4100; 250Mhrz; 132MB of RAM > > In this ENV I have Apache 1.3.24 from the apache.org and PHP > > 4.2.1 from php.net. > > I do not use tools for Windows system like PHPTRIAD > > (www.phpgeek.com) > > > > In this ENV XPTAH work fine and the performance are enough good ( > > I compare it with DOM API Class from this site > > http://devil.medialab.at/projects/phpdom/doc/phpDOM_Demo.html). > > > > In this ENV not problems, > > now................................................. > > > > 2. W98 P133 Unisys 32MB of RAM . > > Also in this ENV I have Apache 1.3.24 from the apache.org and PHP > > 4.2.1 from php.net and I do not use any Windows tools for Apache > > and PHP. > > > > In this ENV the same sample and code PHP that work fine in the > > WinNT ENV do not work. > > > > The error that I have it is this: > > > > XPath error in Xpath.class.php:1333 In importFromFile(): > > The url > > 'http://localhost/FEDRAXPATH/SV/PHP/XML/Elenco_Pratiche.xml' > > could not be found or read. > > > > Warning: Invalid argument supplied for foreach() in > > C:\Programmi\Apache > > Group\Apache\htdocs\FEDRAXPATH\SV\PHP\CLASSUTILITY\mieProve\Xpath > >.class.php on line 1860 > > > > XPath error in Xpath.class.php:4224 The supplied xPath-query > > '/Elenco_Pratiche[1]' does not match *any* node in the xml > > document. > > > > XPath error in Xpath.class.php:966 Couldn't get an exclusive lock > > on the c:/programmi/apache > > group/apache/htdocs/FEDRAXPATH/SV/PHP/XML/Elenco_Pratiche.xml > > file. > > > > Before to close my msg I have see a very strangeness. > > > > At the start the XML file Elenco_Pratiche.XML it is like this: > > > > <?xml version="1.0" ?> > > <Elenco_Pratiche> > > <RECORD> > > <Cod_Pratica>null</Cod_Pratica> > > <Mod_Base>null</Mod_Base> > > <Denominazione>null</Denominazione> > > <Ultimo_Agg>null</Ultimo_Agg> > > <Ultimo_Scar>null</Ultimo_Scar> > > <Tipo_Scar>null</Tipo_Scar> > > </RECORD> > > </Elenco_Pratiche> > > > > I want to clone this NODE and CHILD with the field and with there > > value of the HTML page generated by PHP code. > > > > After to execute my code PHP and when I have a error the file XML > > Elenco_Pratiche.xml are empty > > > > Thanks all for response. I like if the Fiends of the NG write me > > also directly. Thanks. > > > > Ciao e grazie. Franco > > www.infocamere.it > fra...@in... > > > > > > > _______________________________________________________________ > > Don't miss the 2002 Sprint PCS Application Developer's Conference > August 25-28 in Las Vegas -- > http://devcon.sprintpcs.com/adp/index.cfm > > _______________________________________________ > Phpxpath-users mailing list > Php...@li... > https://lists.sourceforge.net/lists/listinfo/phpxpath-users |
From: Pozzer F. <fra...@in...> - 2002-05-31 08:55:47
|
Thanks Peter for your response. I try to replay if your msg and I add same consideration. To the first the problems it is unresolved! Peter Robins wrote: > it looks like you're trying to read a local file with a url which it > can't find. All the other errors are coming because of that. > > 1. does this url actually exist? :-) (can you view it in your > browser?) Yes. It it my desktop localhost. The Path it is: C:\Programmi\Apache Group\Apache\htdocs\FEDRAXPATH\SV\PHP\XML In the httpd.conf I have: ServerRoot "C:/Programmi/Apache Group/Apache" and DocumentRoot "C:/Programmi/Apache Group/Apache/htdocs". If I want to display XMl file Elenchi_Pratiche.xml I f true it to the path of the web_server. I tue it and I can to see it from the browser. > 2. is allow_url_fopen on? it generally is, but you never know . . . Yes. PHP work as apache module. PHP.INI it is in the Windows/system ad all .Dlls are in windows/system. In the PHP.INI I have the doc_root = C:/Programmi/Apache Group/Apache/htdocs and extension_dir = C:/Php/php-4.2.1-Win32/extensions > 3. if all you are doing is reading local files, it would be much > better/faster to read from local filesystem rather than using http Ok this it is very interesting and I think of it about. But the very important I thinks it is the Elenco_Partiche.xml I find after the execute code. It is empty. I have lost all this content: <?xml version="1.0" ?> <Elenco_Pratiche> <RECORD> <Cod_Pratica>null</Cod_Pratica> <Mod_Base>null</Mod_Base> <Denominazione>null</Denominazione> <Ultimo_Agg>null</Ultimo_Agg> <Ultimo_Scar>null</Ultimo_Scar> <Tipo_Scar>null</Tipo_Scar> </RECORD> </Elenco_Pratiche> I am very afrait for this. My last try it is to configure PHp as CGI instead Apache module and at ent ad re-install w98 and Apache and PHP and I try again XPath. Please, replay to my also at my e-mail. Ciao Franco. > > > On Wednesday 29 May 2002 10:00, Pozzer Franco wrote: > > > Thanks for all. I hope to explain well my problem. > > > > > > I have to make same little code PHP to use XPtah for to > > > understand how work it in the XML structure. > > > > > > I have two ENV where I try XPath: WinNT and W98. I describe it: > > > > > > 1. WinNT Server PII AcerPower4100; 250Mhrz; 132MB of RAM > > > In this ENV I have Apache 1.3.24 from the apache.org and PHP > > > 4.2.1 from php.net. > > > I do not use tools for Windows system like PHPTRIAD > > > (www.phpgeek.com) > > > > > > In this ENV XPTAH work fine and the performance are enough good ( > > > I compare it with DOM API Class from this site > > > http://devil.medialab.at/projects/phpdom/doc/phpDOM_Demo.html). > > > > > > In this ENV not problems, > > > now................................................. > > > > > > 2. W98 P133 Unisys 32MB of RAM . > > > Also in this ENV I have Apache 1.3.24 from the apache.org and PHP > > > 4.2.1 from php.net and I do not use any Windows tools for Apache > > > and PHP. > > > > > > In this ENV the same sample and code PHP that work fine in the > > > WinNT ENV do not work. > > > > > > The error that I have it is this: > > > > > > XPath error in Xpath.class.php:1333 In importFromFile(): > > > The url > > > 'http://localhost/FEDRAXPATH/SV/PHP/XML/Elenco_Pratiche.xml' > > > could not be found or read. > > > > > > Warning: Invalid argument supplied for foreach() in > > > C:\Programmi\Apache > > > Group\Apache\htdocs\FEDRAXPATH\SV\PHP\CLASSUTILITY\mieProve\Xpath > > >.class.php on line 1860 > > > > > > XPath error in Xpath.class.php:4224 The supplied xPath-query > > > '/Elenco_Pratiche[1]' does not match *any* node in the xml > > > document. > > > > > > XPath error in Xpath.class.php:966 Couldn't get an exclusive lock > > > on the c:/programmi/apache > > > group/apache/htdocs/FEDRAXPATH/SV/PHP/XML/Elenco_Pratiche.xml > > > file. > > > > > > Before to close my msg I have see a very strangeness. > > > > > > At the start the XML file Elenco_Pratiche.XML it is like this: > > > > > > <?xml version="1.0" ?> > > > <Elenco_Pratiche> > > > <RECORD> > > > <Cod_Pratica>null</Cod_Pratica> > > > <Mod_Base>null</Mod_Base> > > > <Denominazione>null</Denominazione> > > > <Ultimo_Agg>null</Ultimo_Agg> > > > <Ultimo_Scar>null</Ultimo_Scar> > > > <Tipo_Scar>null</Tipo_Scar> > > > </RECORD> > > > </Elenco_Pratiche> > > > > > > I want to clone this NODE and CHILD with the field and with there > > > value of the HTML page generated by PHP code. > > > > > > After to execute my code PHP and when I have a error the file XML > > > Elenco_Pratiche.xml are empty > > > > > > Thanks all for response. I like if the Fiends of the NG write me > > > also directly. Thanks. > > > > > > Ciao e grazie. Franco > > > > www.infocamere.it > > fra...@in... > > > > > > > > > > > > > > _______________________________________________________________ > > > > Don't miss the 2002 Sprint PCS Application Developer's Conference > > August 25-28 in Las Vegas -- > > http://devcon.sprintpcs.com/adp/index.cfm > > > > _______________________________________________ > > Phpxpath-users mailing list > > Php...@li... > > https://lists.sourceforge.net/lists/listinfo/phpxpath-users |
From: Pozzer F. <fra...@in...> - 2002-06-03 08:16:16
|
Thanks very much Peter. This it is the line of code PHP where I have problem: $XpathPratica->importFromFile("http://localhost/FEDRAXPATH/SV/PHP/XML/Elenco_Pratiche.xml"); I have change this line in two way: 1. $document_root = getenv('DOCUMENT_ROOT'); $XpathPratica->importFromFile($document_root."/FEDRAXPATH/SV/PHP/XML/Elenco_Pratiche.xml"); oppure 2. $document_root = getenv('DOCUMENT_ROOT'); $fp = fopen($document_root."/FEDRADOM/SV/PHP/XML/Elenco_Pratiche.xml", "w+" ); $XpathPratica->importFromFile($fp); Let me to ask of all what it is better for the performance 1. or 2. Now I try to change in all my PHP code the path. After this I try again to test XPtah V.3.0 in W98 and W95 also. Thanks for all. If you have same help to test XPtah in W95 send me e-mail, please, with how to do I have to make. Ciao Franco. Peter Robins wrote: > it looks like you're trying to read a local file with a url which it > can't find. All the other errors are coming because of that. > > 1. does this url actually exist? :-) (can you view it in your > browser?) > 2. is allow_url_fopen on? it generally is, but you never know . . . > 3. if all you are doing is reading local files, it would be much > better/faster to read from local filesystem rather than using http > > On Wednesday 29 May 2002 10:00, Pozzer Franco wrote: > > > Thanks for all. I hope to explain well my problem. > > > > > > I have to make same little code PHP to use XPtah for to > > > understand how work it in the XML structure. > > > > > > I have two ENV where I try XPath: WinNT and W98. I describe it: > > > > > > 1. WinNT Server PII AcerPower4100; 250Mhrz; 132MB of RAM > > > In this ENV I have Apache 1.3.24 from the apache.org and PHP > > > 4.2.1 from php.net. > > > I do not use tools for Windows system like PHPTRIAD > > > (www.phpgeek.com) > > > > > > In this ENV XPTAH work fine and the performance are enough good ( > > > I compare it with DOM API Class from this site > > > http://devil.medialab.at/projects/phpdom/doc/phpDOM_Demo.html). > > > > > > In this ENV not problems, > > > now................................................. > > > > > > 2. W98 P133 Unisys 32MB of RAM . > > > Also in this ENV I have Apache 1.3.24 from the apache.org and PHP > > > 4.2.1 from php.net and I do not use any Windows tools for Apache > > > and PHP. > > > > > > In this ENV the same sample and code PHP that work fine in the > > > WinNT ENV do not work. > > > > > > The error that I have it is this: > > > > > > XPath error in Xpath.class.php:1333 In importFromFile(): > > > The url > > > 'http://localhost/FEDRAXPATH/SV/PHP/XML/Elenco_Pratiche.xml' > > > could not be found or read. > > > > > > Warning: Invalid argument supplied for foreach() in > > > C:\Programmi\Apache > > > Group\Apache\htdocs\FEDRAXPATH\SV\PHP\CLASSUTILITY\mieProve\Xpath > > >.class.php on line 1860 > > > > > > XPath error in Xpath.class.php:4224 The supplied xPath-query > > > '/Elenco_Pratiche[1]' does not match *any* node in the xml > > > document. > > > > > > XPath error in Xpath.class.php:966 Couldn't get an exclusive lock > > > on the c:/programmi/apache > > > group/apache/htdocs/FEDRAXPATH/SV/PHP/XML/Elenco_Pratiche.xml > > > file. > > > > > > Before to close my msg I have see a very strangeness. > > > > > > At the start the XML file Elenco_Pratiche.XML it is like this: > > > > > > <?xml version="1.0" ?> > > > <Elenco_Pratiche> > > > <RECORD> > > > <Cod_Pratica>null</Cod_Pratica> > > > <Mod_Base>null</Mod_Base> > > > <Denominazione>null</Denominazione> > > > <Ultimo_Agg>null</Ultimo_Agg> > > > <Ultimo_Scar>null</Ultimo_Scar> > > > <Tipo_Scar>null</Tipo_Scar> > > > </RECORD> > > > </Elenco_Pratiche> > > > > > > I want to clone this NODE and CHILD with the field and with there > > > value of the HTML page generated by PHP code. > > > > > > After to execute my code PHP and when I have a error the file XML > > > Elenco_Pratiche.xml are empty > > > > > > Thanks all for response. I like if the Fiends of the NG write me > > > also directly. Thanks. > > > > > > Ciao e grazie. Franco > > > > www.infocamere.it > > fra...@in... > > > > > > > > > > > > > > _______________________________________________________________ > > > > Don't miss the 2002 Sprint PCS Application Developer's Conference > > August 25-28 in Las Vegas -- > > http://devcon.sprintpcs.com/adp/index.cfm > > > > _______________________________________________ > > Phpxpath-users mailing list > > Php...@li... > > https://lists.sourceforge.net/lists/listinfo/phpxpath-users |
From: Pozzer F. <fra...@in...> - 2002-06-05 11:50:16
|
> Thanks for all. I hope to explain well my problem. I try again to work with XPath Class in W98. I have install Apache 1.3.24 and PHP 4.2.1. PHP work as CGI. The document_root it is C:\Programmi\Apache Group\Apache\htdocs I have this code in my PHP: echo"0<br>"; copy("../../pratiche/modello.xml","../../pratiche/".$nomePratica.".xml"); echo"1<br>"; $xmlOptions = array(XML_OPTION_SKIP_WHITE => TRUE); echo"2<br>"; $XpathPratica = new XPath(FALSE, $xmlOptions); echo"3<br>"; global $elenco_pratExt; echo"4<br>"; $XpathPratica->importFromFile($elenco_pratExt."Elenco_Pratiche.xml"); echo"5<br>"; $xPathQuery='/*/*[last()]'; echo"6<br>"; $xPathSet = $XpathPratica->match($xPathQuery); echo"7<br>"; $clone = $XpathPratica->cloneNode($xPathSet[0]); echo"8<br>"; $XpathPratica->replaceData($xPathQuery."/Cod_Pratica[1]","$nomePratica"); echo"9<br>"; $XpathPratica->replaceData($xPathQuery."/Mod_Base[1]","I1"); echo"10<br>"; $XpathPratica->replaceData($xPathQuery."/Denominazione[1]","Pratica_$nomePratica"); echo"11<br>"; $dataCreazione=date("Y")."-".date("m")."-".date("d")." ".date("H").":".date("i").":".date("s"); echo"12<br>"; $XpathPratica->replaceData($xPathQuery."/Ultimo_Agg[1]","$dataCreazione"); echo"13<br>"; $XpathPratica->appendChild('/Elenco_Pratiche[1]', $clone, $shiftRight=FALSE); echo"before exportToFile<br>"; $XpathPratica->exportToFile($elenco_pratExt."Elenco_Pratiche.xml"); echo"after exportToFile<br>"; In bold line after I have an error. To the browser have this comment: 0 1 2 3 4 5 6 7 8 9 10 11 12 13 before exportToFile XPath error in XPath.class.php:966 Couldn't get an exclusive lock on the c:/programmi/apache group/apache/htdocs/fedraxpath/pratiche/Elenco_Pratiche.xml file. after exportToFile > I do not undestand the problems. Please replay to me in NG but also from my e-mail. Thanks very much for all. fra...@in... > > |
From: Sam B. <bs...@us...> - 2002-06-05 16:37:24
|
> before exportToFile > XPath error in XPath.class.php:966 Couldn't get an exclusive lock on the > /...../Elenco_Pratiche.xml file. > after exportToFile - - Hi Franco Found a bug repport on that problem in the PHP bug DB. File locking isn't supported with Windows 95/98. I tried to modify the code to ignore file lockings when using windows 95/98. Could you try out the passed version and give me a feedback. I will then add the update to sourceforge. Cheers -- Sam Blum <bs...@us...> =========================== For the most recent version of PHP.XPath and an archive of this list visit: http://sourceforge.net/projects/phpxpath |