XML : How can I remove any footnote or notes or end notes in my Xpathselectelement

I have an html that contains this value

  <h3 class="sgc-5">Blah blah<sup class="fn-num"><a id="r_fn1" href="#fn1">1</a></sup></h3>    

for me to get the value of the h3, I used the code below

  XDocument xDoc = XDocument.Parse(xml);  Console.WriteLine(xDoc.XPathSelectElement("//h3").Value)    

and I get the result Blah Blah1, but the result what I want is Blah Blah only I want to remove 1 in the result, I try .Remove() to remove the 1 in the end of Blah blah, but this is not safe, as it will remove all the end of the h3.Value that contains 1, Can anyone show me how to not include the value <sup class="fn-num"> in the xDoc.XPathSelectElement("//h3").Value in my case.

No comments:

Post a Comment