XML parsing: line 6, character 2, whitespace expected
DECLARE @x XML = '<table WIDTH="100%" CELLPADDING="1" CELLSPACING="1"><tr style="COLOR:black; FONT-FAMILY: Arial;FONT-SIZE: 10pt; BACKGROUND-COLOR: #f2f2f2;">
<td><b>Medical Record No. : </b>1165677</td><td><b>Patient Name : </b>MASTER. SURYANARAYANAN T S </td><td><b>Age : </b>16 Year(s)</td><td><b>Sex : </b>male
</td></tr></table>
<A HREF="#" TARGET="_top" onContextMenu="event.returnValue=false;
"onclick ="window.parent.document.getElementById("Base_pgContentHolder_pgContent_hdnScrnId").value="EMRFIRST";
window.parent.document.getElementById("imgOpenHistory").click();return false;">
<b>Main Complaints</b></a>
</table>'
SELECT t.c.value('.', 'NVARCHAR(MAX)')
FROM @x.nodes('*') t(c)
when i run the above shows error as follows
XML parsing: line 6, character 2, whitespace expected
line 6 as follows
"onclick ="window.parent.document.getElementById("Base_pgContentHolder_pgContent_hdnScrnId").value="EMRFIRST";
window.parent.document.getElementById("imgOpenHistory").click();return false;">