Send a blank email to [email protected] to get a copy of this message
Hi all,
This silly little problem took quite a while to figure out without using any regular expression hacks, so here goes (example using XHTML namespace):
// Initialize
$doc = new DOMDocument;
$doc->load('somefile.xhtml');
// Remove XHTML namespace declaration
$doc->documentElement->removeAttributeNS('http://www.w3.org/1999/xhtml',
'');
// Get the XML contents without XML and doctype declarations
$text => $doc->saveXML($doc->documentElement))
// Now you can use this to e.g. process several XML documents in XSLT
$proc->setParameter(NULL,
PS: I tried to submit this as a PHP documentation note, but my IP is blocked for some reason.
PPS: Coming soon to a website near you ;)
--
Victor Engmark