Howdy,
I have an XML document consisting of nodes that contain HTML markup.
For example:
<whatsnew>
<news>
A <em>really</em> funny thing happened on the way to the forum.
</news>
<news>
For more information, <a href="newpage.phtml">look here</a>.
</news>
<whatsnew>
What I'm ultimately trying to do is display the content of the
<news> node, WITH all of the included markup. I'm using the DOM
XML functions (PHP 4.04, I think, but any version would do) to
parse this information from a file into various substructures.
However, my attempts to get at that node's content is coming up
just a little short.
I've been trying two different approaches. First, I was trying
to use the content() method on the <news> node; however, this
stops as soon as it gets to the first markup tag, since that's a
new child. If I concatenate the content() results of ALL
children of <news>, I get the text with the markup stripped out.
Then I started trying to use dumpmem(), however this only works
on a DOM Document. This seems like it would be the better
approach to take, but I can't figure out how to make a DOM
Document from only a subnode of the original document. I can use
xpath_eval to get the exact section I want, but that returns an
array of nodes, which I can't get into a DOM Document.
So, how can I pull this off?
Thanks in advance,
- Keith