[PHP] Re: SimpleXML: DOM, SAX or Other?
Phpdiscuss - Php Newsgroups And Mailing Lists wrote: Hi, Does anybody have any depthful knowledge of the SimpleXML extension in PHP5?.. More accurately, do you know if the simpleXml-xpath() method uses DOM, SAX or some other method of parsing a loaded XML document? I ask because I am trying to parse arbitrary XML documents as efficiently as possible (avoiding DOM). Kieran Hi, I've recently done a fair bit of work trying to make sense (for me) of the various PHP 5 XML-related alternatives. The bottom line (for me) is that at the end of the day the DOM functions provide the most access and flexibility, although at the cost of slightly more design complexity. If I have to generate a new XML file, DOM (for me) is the way to go. The XML Parser found its home (for me) processing include files. The output of this process is a single XML file that I can feed into downstream processes. The SimpleXML routines found its home (for me) working with static XML files. I haven't figured out how to add elements to a SimpleXML object, so it tends to be limited to read-only applications. The SimpleXMLIterator found a home (for me) in creating ID's and node genelogical ID's. Oddly, the SimpleXMLIterator skips the root level xml element and I had to use DOM to add it back. I ended up creating wrappers and proxy classes for each of the above. This allowed me to gain some uniformity in my API's so tend to forget about what's happening underneath. I also ended up creating a DomXPathQueryManager class to hide some of the complexity in setting up and executing XPath queries. So, at the end of the day, I might use any or all in some combination, but know that the DOM functions are my backup that can do it all. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Q re: php-5.0.2 ./configure --with-soap --with-openssl --with-tidy (copy)
Curt Zirzow wrote: * Thus wrote Bill McCuistion: Q re: php-5.0.2 ./configure --with-soap --with-openssl --with-tidy Hello all. Hoping for some direction with the above step. Have PHP-5.0.2 and can configure the soap and openssl options, but when I add the tidy option, the operation stops with the following message. -- checking for TIDY support... yes -- configure: error: Cannot find libtidy I have of course gotten the latest tidy source (1.1) from sourceforge, but don't understand what to do with it. The rpm doen't seel to load the libtidy as I was hoping it would. Further to my confusion, the PHP docs speak to using tidy 2.0 with PHP5, but can not locate any other refs to tidy 2.x) I've never have used the rpm for tidy, but in general it should in theory install libtidy in either /usr/lib or /usr/local/lib so you'll need to configure php like: ./configure --with-tidy=/usr or ./configure --with-tidy=/usr/local If that doesn't work, then the rpm may not have installed the libtidy. As for the tidy 2.x reference, that is referencing php's interface to tidy: tidy 1.0: for php4.x tidy 2.0: for php5.x Both tidy's use the same libtidy, it is just that 2.0 includes the new OO interface that PHP5 provides. Curt Curt, Thanks for the reply. The rpm I found only contains tidy src files. I seem to have the chicken and egg problem. How do I make a libtidy that PHP will be satisfied with? I would prefer to use the PHP5 OO interface. Following is the command sequence showing my dilema... [EMAIL PROTECTED] tidy]# pwd /usr/src/tidy [EMAIL PROTECTED] tidy]# rpm -i tidy-20030525-1.src.rpm warning: user hany does not exist - using root warning: group hany does not exist - using root warning: user hany does not exist - using root warning: group hany does not exist - using root warning: user hany does not exist - using root warning: group hany does not exist - using root [EMAIL PROTECTED] tidy]# ls bin package.xml tidy tidy-1.1 tidy-1.1.tar tidy-20030525-1.src.rpm tidy_docs.tar tidy_linux_x86.tar [EMAIL PROTECTED] tidy]# tar -xvf tidy-1.1.tar [EMAIL PROTECTED] tidy]# cd tidy-1.1 [EMAIL PROTECTED] tidy]# phipize [EMAIL PROTECTED] tidy-1.1]# ls acinclude.m4config.guess config.nice CREDITS install-sh Makefile.global php_tidy.h TODO aclocal.m4 config.h.in config.subdoit.libtidy.sh *.loT Makefile.objects README autom4te.cache config.logconfigure examples ltmain.sh missing tests build config.m4 configure.in include Makefile.fragments mkinstalldirs tidy.c [EMAIL PROTECTED] tidy-1.1]# ./configure checking build system type... i686-redhat-linux-gnu checking host system type... i686-redhat-linux-gnu checking for gcc... gcc checking for C compiler default output file name... a.out checking whether the C compiler works... yes checking whether we are cross compiling... no checking for suffix of executables... checking for suffix of object files... o checking whether we are using the GNU C compiler... yes checking whether gcc accepts -g... yes checking for gcc option to accept ANSI C... none needed checking whether gcc and cc understand -c and -o together... yes checking if compiler supports -R... no checking if compiler supports -Wl,-rpath,... yes checking for PHP prefix... /usr/local checking for PHP includes... -I/usr/local/include/php -I/usr/local/include/php/main -I/usr/local/include/php/Zend -I/usr/local/include/php/TSRM checking for PHP extension directory... /usr/local/lib/php/extensions/no-debug-non-zts-20040412 checking for re2c... exit 0; checking for gawk... gawk checking for TIDY support... yes, shared configure: error: Cannot find libtidy Perhaps I've gotten something in my system (besides myself) horribly confused or am completely on the wrong path. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: simplexml question.
[EMAIL PROTECTED] wrote: Hello, I looking to get the data out of this test.xml file but dont know how to get the data out because of the bo: namespaces. If I remove all bo: from the xml then it works fine... Is anyone can tell me how to do it? ?php $file = test.xml; $xml = simplexml_load_file($file) or die (Unable to load XML file!); echo Name: . $xml-UserAuthRequest-UserLoginName . \n; ? test.xml: ?xml version=1.0 encoding=UTF-8? bo:TXLife xsi:schemaLocation=http://ACORD.org/Standards/Life/2 TXLife2.9.90.XSD xmlns:bo=http://ACORD.org/Standards/Life/2; xmlns:xsi=http://www.w3.org/2001/XMLSchema-instance; bo:UserAuthRequest bo:UserLoginNameTest login/bo:UserLoginName Thanks, Andras Kende I couldn't get SimpleXML (nor the SimpleXMLIterator) to work with NS-enabled xml. Had to use DOM functions. Sorry if this is bad news. Would be interested if I missed a setting that enabled NS-support for SimpleXML. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Q re: php-5.0.2 ./configure --with-soap --with-openssl --with-tidy (copy)
Q re: php-5.0.2 ./configure --with-soap --with-openssl --with-tidy Hello all. Hoping for some direction with the above step. Have PHP-5.0.2 and can configure the soap and openssl options, but when I add the tidy option, the operation stops with the following message. -- checking for TIDY support... yes -- configure: error: Cannot find libtidy I have of course gotten the latest tidy source (1.1) from sourceforge, but don't understand what to do with it. The rpm doen't seel to load the libtidy as I was hoping it would. Further to my confusion, the PHP docs speak to using tidy 2.0 with PHP5, but can not locate any other refs to tidy 2.x) My system is Fedora Core 2 (and is pretty standard and otherwise up-to-date). I of course would like to get the TidyLib functions enabled within the PHP5 core. The command-line version works just fine, but I don't remember from whence it came. Any help would be most appreciated. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] PHP XML
Dan Joseph wrote: how is the xml being sent to you from the other place on the internet? is it being posted in a form, etc.? It won't be thru a form. I guess it'll be a direct send, he'll format something like... request nameJack/name account239048098324/account /request ... in a string and send it over. What methods are best suited for something like that? Would it be best Side One to open a socket up to Side Two and send it thru that way? I'm open to suggestions... -Dan Joseph Look at the SOAP functions. There's a SOAP client SOAP server. The applications use SOAP calls to transfer their XML messages over the Intenet, typically http/https, but could also use smtp for transport. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: https://...
Afan Pasalic wrote: hi, how can I check using php that I use SSL? tried with REQUEST_URI HTTP_HOST PATH_INFO but any of these does show http:// Thanks! -afan from the command line... php -m should list openssl if ./configure --with-openssl option specified. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] PHP Compiler?
Sorry if this is an old question: Where can I find information on any plans to create a compiler for PHP, especially v5.x? Barring that, is there a PHP syntax checker that would enforce some of the types of things that a compiler would find? I remember from back in my MS-DOS days the very good Clipper compiler for the dBase III language. dBase III, not unlike PHP, was an interpretive language, and along the way some bright folks figured out how to write a true dBase language compiler, which then allowed for all sorts of nice things to happen. One of the nicest things for me was that the compiler caught all sorts of little things before the same code in the interpreter would find them at run-time. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php