Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 1085277
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T22:40:09+00:00 2026-05-16T22:40:09+00:00

I am attempting to send html data in a question form from my php

  • 0

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:

Catchable fatal error: Object of class DOMNodeList could not be converted to string in urlgoeshere.php on line 35

Here’s the current code I’m working with…

$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> ';

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 –
What PHP code will help me parse html data in an xml form?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-16T22:40:10+00:00Added an answer on May 16, 2026 at 10:40 pm

    Take a look at DOMDocument for working with DOM/xml in PHP. If you want to embed HTML in your XML, use CDATA sections like this:

    $QuestionXML = '<QuestionForm xmlns="http://mechanicalturk.amazonaws.com/AWSMechanicalTurkDataSchemas/2005-10-01/QuestionForm.xsd">
      <Question>
        <QuestionContent>
          <Text><![CDATA['.$thequestion.']]></Text>
        </QuestionContent>
        <AnswerSpecification>
          <FreeTextAnswer/>
        </AnswerSpecification>
      </Question>
    </QuestionForm> ';
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am attempting to send a json message from a custom application to a
I'm attempting to send a .proto message from an iPhone application to a Java
I am attempting to send data back to my objective c program from javascript.
I'm attempting to send a piece of data through jQuery .ajax() to a PHP
I am attempting to send an HTML email from a symfony (1.4.6) task, I
I am attempting to add data to my database from my HTML code via
I'm attempting a basic AJAX call where I send the address 'www.google.com' to urlpost.php
Attempting to use the data series from this example no longer passes the JSONLint
I am attempting to send a javascript array to my web server for an
I'm attempting to send an HTTP POST to a Rails 3 Application. Currently all

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.