Reputation: 2850
FalseAWS.MechanicalTurk.XMLParseErrorThere was an error parsing the XML question or answer data in your request. Please make sure the data is well-formed and validates against the appropriate schema. (1284779956270)Array00
I'm trying to send entire emails to mechanical turk, and I am using the mtturk.lib.php library to send this. I tried urlencode and htmlentities to attempt to send it, I'm sure there's a function that will make this code "formatted well enough" to send it through.
$thequestion = '<a href="linkgoeshere" target="_blank">click here</a>';
$QuestionXML = '<QuestionForm xmlns="http://mechanicalturk.amazonaws.com/AWSMechanicalTurkDataSchemas/2005-10-01/QuestionForm.xsd">
<Question>
<QuestionContent>
<Text>'.$thequestion.'</Text>
</QuestionContent>
<AnswerSpecification>
<FreeTextAnswer/>
</AnswerSpecification>
</Question>
</QuestionForm> ';
Upvotes: 0
Views: 326
Reputation: 9592
html code inside an xml document may be embedded in a number of ways:
htmlspecialchars()
and send it<![CDATA[ ... ]]>
sectiondifferent xml parsers may support or not the third method, I'd go with the first or the second one.
Upvotes: 0
Reputation: 81452
HTML is not a form of XML; don't try to parse it as such. Your best bet is to use a HTML5 parser, or, failing to obtain that, an SGML parser.
Upvotes: 2