Debugging of object of DomXPath and DomDocument. [message #170273] |
Mon, 25 October 2010 09:15 |
plmqaz
Messages: 1 Registered: October 2010
Karma: 0
|
Junior Member |
|
|
Hello All,
We use echo or print_r to get value of variables while debugging PHP
code.
But, object of domXPath or DomDocument are not captured in echo or
print_r.
How to get values from above objects while debugging PHP code?
Thanks in advance.
|
|
|
Re: Debugging of object of DomXPath and DomDocument. [message #170275 is a reply to message #170273] |
Mon, 25 October 2010 11:35 |
bobmct
Messages: 16 Registered: September 2010
Karma: 0
|
Junior Member |
|
|
On Mon, 25 Oct 2010 02:15:34 -0700 (PDT), plmqaz <pwpradeep(at)gmail(dot)com>
wrote:
> Hello All,
>
> We use echo or print_r to get value of variables while debugging PHP
> code.
>
> But, object of domXPath or DomDocument are not captured in echo or
> print_r.
>
> How to get values from above objects while debugging PHP code?
>
>
> Thanks in advance.
I use the firefox browser with the firebug extension installed.
Captures DOM activity quite well.
|
|
|
Re: Debugging of object of DomXPath and DomDocument. [message #170276 is a reply to message #170273] |
Mon, 25 October 2010 17:00 |
matt[1]
Messages: 40 Registered: September 2010
Karma: 0
|
Member |
|
|
On Oct 25, 5:15 am, plmqaz <pwprad...@gmail.com> wrote:
> Hello All,
>
> We use echo or print_r to get value of variables while debugging PHP
> code.
>
> But, object of domXPath or DomDocument are not captured in echo or
> print_r.
>
> How to get values from above objects while debugging PHP code?
>
> Thanks in advance.
Check out the undocumented C14N() function. Will export a DOMElement
to an XML string. Very useful for visual inspection of document
fragments.
Otherwise, with DOMDocument, use saveHTML() or saveXML(). The output
of that is probably a lot more readable than if print_r() actually did
recurse the entire object.
|
|
|