$doc = new DOMDocument();
$doc -> load("state.xml");
...snip...
$neworder = $doc -> createElement("order");
$neworder -> appendChild($type);
最後のコード行が原因でスクリプトが失敗しています。 500 HTTP応答。私がコメントアウトすると、スクリプトは正常に動作します。このPHP DOMコードの何が問題になっていますか?
get_class()は、$ neworderと$ typeの両方がDOMElementクラスであることを確認します。何が問題なの?
...私は私が追加しようとしているノードを取得していた場所に:
$タイプがどこから来るかこれは。
DOM_WRONG_DOCUMENT_ERR
Raised if newnode was created from a different document than the one that created this node.
[エラー500が表示されるのはなぜですか](http://stackoverflow.com/questions/4651083/why-do-i-get-error-500) – AgentConundrum
エラーメッセージは何ですか? –
PHP致命的なエラー:メッセージ 'Wrong Document Error'でキャッチされていない例外 'DOMException'。 –