質問形式でHTMLデータをPHPWebアプリケーションからMechanicalTurkに送信して、ユーザーが電子メールからHTMLドキュメント全体を表示して操作できるようにしようとしています。私はこれまで苦労しました。以下にリンクされているスレッドで、html5-lib.phpを使用してhtmlデータを解析しようとしましたが、これを完了するための手順がまだ不足していると思います。
私が受け取っている現在のエラーは次のとおりです。
Catchable fatal error: Object of class DOMNodeList could not be converted to string in urlgoeshere.php on line 35
これが私が使用している現在のコードです...
$thequestion = '<a href="linkgoeshere" target="_blank">click here</a>';
$thequestion = HTML5_Parser::parseFragment($thequestion);
var_dump($thequestion);
echo $thequestion;
//htmlspecialchars($thequestion);
$QuestionXML = '<QuestionForm xmlns="http://mechanicalturk.amazonaws.com/AWSMechanicalTurkDataSchemas/2005-10-01/QuestionForm.xsd">
<Question>
<QuestionContent>
<Text>'.$thequestion.'</Text> //<--- Line35
</QuestionContent>
<AnswerSpecification>
<FreeTextAnswer/>
</AnswerSpecification>
</Question>
</QuestionForm> ';
パーサーがこれを正しく送信するために必要なことであるかどうかは100%わかりません-私がやりたいのは、このxmlタイプのドキュメントを介してhtmlを送信することだけです-これまでのところこれほど困難であったことに驚いています。
これは、別のスレッドの続きの ようなものです-xml形式のhtmlデータを解析するのに役立つPHPコードは何ですか?