Jump to content

XPATH,DOM, query elements and get full content


Mic-Ls

Recommended Posts

I use DomDocument to get an HTML page content and parse (loadHTMLFile).

I use DOMXPath with contex to the DomDocument to query elements.

say this is the query string
"//table//tr"

using
DOMXPath->query

to search all TR under TABLE in page.
and then iterate on returned data.

now to get the value of the  returned data I use [b]nodeValue[/b]
and what i get is only text, while <A> or other its just hide.

so my question is how can I use the method above and also be able to get the full string  in the  result. (like innerHTML)


<TABLE>
<TR>
<A href="void">hello</A>
</TR>
</TABLE>


will output only the hello text without the A tag.

I hope I Explain my problem properly.

Thanks  :)

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.