FUDforum
Fast Uncompromising Discussions. FUDforum will get your users talking.

Home » Imported messages » comp.lang.php » Debugging of object of DomXPath and DomDocument.
Show: Today's Messages :: Polls :: Message Navigator
Switch to threaded view of this topic Create a new topic Submit Reply
Debugging of object of DomXPath and DomDocument. [message #170273] Mon, 25 October 2010 09:15 Go to next message
plmqaz is currently offline  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 Go to previous messageGo to next message
bobmct is currently offline  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 Go to previous message
matt[1] is currently offline  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.
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: Stats comp.lang.php (last 7 days)
Next Topic: IT job
Goto Forum:
  

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ]

Current Time: Sun Nov 10 14:05:17 GMT 2024

Total time taken to generate the page: 0.01824 seconds