DOM Question. No pun intended.

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi All,

I'm having HTML DOM troubles. Is there any way to output the *EXACT* code contained in a node (child nodes and all)? For instance, I perform a $doc->loadHTML($file) and all
is well.  I then search through the document for specific NODEs with
getElementsByTagName(). However, when I go to output the data from that node (say a specific DIV) I simply get the text without formatting and the like. Basically, I want the retrieved NODE to echo exactly what is contained. If the
div looks like the following:

<div id="name">
<table>
stuff
</table>
</div>

. . .I want it to give me exactly that when I do a NODE->textContent or
NODE->nodeValue. I don't want just the text, I want all tags contained, etc.
It would be nice to have DOMNode->saveHTML() similar to the
DOMDocument->saveHTML().

FYI, I'm using the technique to "screen scrape" portions of other pages from my site and compile items for a quick fix. Fortunately all my DIVs have IDs and I can loop through and find them by that attribute's value. I just can't output
their EXACT data once I have them.  :-\

Thanks!

[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux