How do I serialize DOM into XML using PHP?

HsHosting

New Member
I am attempting to send html data in a question form from my php web application to mechanical turk so a user can see the entire html document from an email to work with. I have had difficulty thus far. In the thread linked below, I attempted to parse the html data using html5-lib.php, but I think I'm still missing a step in order to complete this. Here's the current error I'm receiving: \[code\]Catchable fatal error: Object of class DOMNodeList could not be converted to string in urlgoeshere.php on line 35\[/code\]Here's the current code I'm working with... \[code\]$thequestion = '<a href="http://stackoverflow.com/questions/3740776/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> ';\[/code\]I'm not 100% sure if the parser is what I need to do in order to have this sent correctly - All I want to do is send html through this xml type document - I'm surprised it's been this difficult thus far. This is somewhat of a continuation of another thread - http://stackoverflow.com/questions/3740257/what-php-code-will-help-me-parse-html-data-in-an-xml-form
 
Back
Top