DOM: Problem with loadXML(), createProcessingInstruction()

From: Date: Tue, 19 Sep 2006 19:15:30 +0000
Subject: DOM: Problem with loadXML(), createProcessingInstruction()
Groups: php.general 
Request: Send a blank email to php-general+get-241953@lists.php.net to get a copy of this message
Apparently, loadXML() overwrites the existing structure of the document when called. The problem is that when I try to add a PI (namely a stylesheet), it adds it to the end of the document thus making so that the XML is not transformed by the client. To get around this, I thought I could just import my XML string into a DOMNode, but I do not see any method for that class analogous to the loadXML(). I looked at the possiblity of adding children to the document at specific positions (such that I could add the PI as the first child) but I do not see a DOMDocument method that allows it. appendChild() merely adds the child to the end of the document. Has anyone found a workaround for this; a workaround the fact that loadXML() completely replaces the existing document structure? thnx, Chris

« previous php.general (#241953) next »