[PHP] Re: Parsing PHP variables in XML document

2006-02-27 Thread Ivan Nedialkov
So I have found this code in http://bg.php.net/manual/en/ref.xmlrpc.php and it evaluates PHP but when I try to use the PIHandler separately. It doesnt work. So I ask if someone could help me to make parser1 return an array just like parser2. PARSER1 ?php $file = xmltest2.xml; function

[PHP] Re: Parsing PHP variables in XML document

2006-02-27 Thread Ivan Nedialkov
I comed up with this ?php $file = xmltest2.xml; $stack = array(); $foo3 = wddw; // start_element_handler ( resource parser, string name, array attribs ) function startElement($parser, $name, $attribs) { global $stack; $tag=array(name=$name,attrs=$attrs); array_push($stack,$tag); } //

[PHP] Re: Parsing PHP variables in XML document

2006-02-26 Thread Bogdan Ribic
Hi Ivan, You might be able to use output buffering in conjunction with including your xml file. Something like: ob_start(); include $xml_file; $content = ob_end_flush(); and then parse the $content string. If you are doing this from within a function and you want access to global

[PHP] Re: Parsing PHP variables in XML document

2006-02-26 Thread Bogdan Ribic
Hmmm, come to think of it, it would only work if short_open_tags ini directive is turned OFF, which in most cases it won't be :( Bogdan Ribic wrote: Hi Ivan, You might be able to use output buffering in conjunction with including your xml file. Something like: ob_start(); include

Re: [PHP] Re: Parsing PHP variables in XML document

2006-02-26 Thread chris smith
On 2/26/06, Bogdan Ribic [EMAIL PROTECTED] wrote: Hmmm, come to think of it, it would only work if short_open_tags ini directive is turned OFF, which in most cases it won't be :( You can turn it off with a htaccess file. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit:

[PHP] Re: Parsing PHP variables in XML document

2006-02-26 Thread Ivan Nedialkov
Well isn't there a way instead of using only variables, to use sth like ?php echo $foo; ? I tried it but it doesnt work The parser returns blank! On Sun, 2006-02-26 at 12:02 +0100, Bogdan Ribic wrote: Hmmm, come to think of it, it would only work if short_open_tags ini directive is turned

[PHP] Re: Parsing PHP variables in XML document

2006-02-26 Thread Bogdan Ribic
Ivan, Did you try entering the code with debugger, or at least printing out what output buffer was holding, ie $content var in my example? Can you post exact code? Also, is short_tags turned on or off in php.ini? If it is on, php will get confused on first line of your xml file, it will