I have the following code, with which I select certain <text> elements from an xml file:
$xml = new DOMDocument();
$xml->load("quotes.xml");
$xpath = new DOMXpath($xml);
$search_results = $xpath->query("/quotes/quote/text[contains(.,'foo')]");
Now, the <text> elements that I am selecting contain mixed content, like so:
<text>Some text with <i>italics</i>, <link>links</link>, and <i><link>italicized links</link></i>.</text>
I would like to retrieve the entire mixed content, i.e. Some text with <i>italics</i>, <link>links</link>, and <i><link>italicized links</link></i>. How can this be done with DOM?
Thanks in advance for your help!