convert xhtml to text format

xhtml , .net , Sydney, Australia
  • 10 years ago


    I am trying to read an xml file.It has some xhtml data as node value.I want to convert that to plain text to save into the database.

    this is an example text:

    Her social-climbing stepmother would give anything to have Madelyn Haywood betrothed to a future duke. But believes the brothers Devine to be nothing more than heartless rogues—especially Gabriel, whose rakish reputation precedes him. He is nothing more than a slave to passion, and she will not be conquered by his caresses­—and yet his wicked ways tempt her so . . .

    Could someone help me how can i convert this type of text to plain text.I want to get rid of that hexadecimal chars and html tags.

    I tried this code.But not worked.

    Dim sb.Append(schild.InnerText)

    Dim sb As New StringBuilder

    Dim sr As New StringWriter(sb)

    Dim htr As New System.Web.UI.HtmlTextWriter(sr)



    Dim lines As String() = htr.InnerWriter.ToString().Split(New String() {vbCr & vbLf}, StringSplitOptions.None)

    Dim SbAboutbook As New StringBuilder

    For Each line As String In lines


    Next blurb = SbAboutbook.ToString()

Post a reply

No one has replied yet! Why not be the first?

Sign in or Join us (it's free).


Why not write for us? Or you could submit an event or a user group in your area. Alternatively just tell us what you think!

Our tools

We've got automatic conversion tools to convert C# to VB.NET, VB.NET to C#. Also you can compress javascript and compress css and generate sql connection strings.

“C++ : Where friends have access to your private members.” - Gavin Russell Baker