I am retreiving some html strings from my database and I would like to parse these strings into my DOMDocument. The problem is, that the DOMDocument gives warnings at specia
I do see the problem in question, and also that the question has been answered, but if I may I'd like to suggest a thought from my past dealing with similar problems.
It just might be so that your task requires including tagged data from the database in the resulting XML, but may or may not require parsing. If it's merely data for inclusion, and not structured parts of your XML, you can place strings from the database in CDATA section(s), effectively bypassing all validation errors at this stage.