I have a string containing the inner value of a DIV (with content editable) coming from client side.
Inside this div there is some SPAN, some P, some Table,... everything you can have.
I'd like to get from this string only the value inside the P element, and sometimes inside the TD of the tables (sometimes a P is inside the TD, sometimes not), and to get the value if it is inside a DIV element.
The string can be :
string text = @"
<P>
tset if it work
<SPAN onresizestart="return false" ondrag=javascript:dragActif(); contentEditable=false style="BACKGROUND-COLOR: #c0d4e6" edth_type="var" edth_var_pob="n" edth_var_pgm="RBLZVALO" edth_var_def="B" edth_var_casse="car" edth_var_lg="050" edth_var_type="c" edth_var_nom="Adr_Leg_Lig1" edth_var_lib="Ligne 1 adresse légale" edth_var_libc="Adr_Leg_Lig1" edth_var_num="1" edth_var_posFich="0">
Adr_Leg_Lig1
</SPAN>
test
</P>
<P>This <FONT size=2 edth_sizeUTIA4="8">should</FONT> Work
</P>"
I have try to parse it to XML with
XmlDocument xd = new XmlDocument();
xd.LoadXML(text);
but it failed, I try to parse it to HTML with this ParseHTML but it failed too.
I tried filtering every possibility with regex, but some times we have to take what is inside <FONT>
like in this example, sometimes we don't.
Is there a way to convert this to HTML on server side with ASP.NET or to convert it to some sort of XML that I could use to manipulate it with its tag and attribute inside the tag ?
EDIT: ASP.NET 2.0, IE5, No Jquery (well IE5) are my configuration, I can't use external libraries.