Good day!

Attempting to parse XML to DOM from string input using QDomDocument::setContent(). However, setContent() returns true regardless of the input and it's driving me nuts.

Text is entered into QTextEdit GUI and then (theoretically) converted to XML in the following function:

Qt Code:
  1. void Class::getXML()
  2. {
  3. domDoc->clear();
  4. //Converts text edit content to HTML and parses to DOM doc
  5. if(!domDoc->setContent(textEdit->toHtml())) {
  6. QMessageBox::information(this,"Error","XML invalid");
  7. } else {
  8. QMessageBox::information(this,"Success",domDoc->toString(4)); //xxxTESTINGxxx
  9. }
  10. }
To copy to clipboard, switch view to plain text mode 

I understand setContent() is supposed to validate the input? Any ideas?

Thanks!