Click here to Skip to main content
15,884,353 members
Articles / Web Development / HTML
Alternative
Tip/Trick

Remove all the HTML tags and display a plain text only inside (in case XML is not well formed)

Rate me:
Please Sign up or sign in to vote.
5.00/5 (4 votes)
20 Dec 2010CPOL 13.1K   1   3
Consider using the open source HTML Agility Pack library (htmlagilitypack.codeplex.com).It lets you use XPATH queries to access very specific parts of an HMTL document, and the HTML does not have to be valid, well-formed XML. In addition to accessing the raw inner text of an element you can...
Consider using the open source HTML Agility Pack library (htmlagilitypack.codeplex.com).

It lets you use XPATH queries to access very specific parts of an HMTL document, and the HTML does not have to be valid, well-formed XML. In addition to accessing the raw inner text of an element you can select specific attribute values, which is useful for getting things like meta description content or image alt/title text.

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


Written By
Web Developer
United States United States
This member has not yet provided a Biography. Assume it's interesting and varied, and probably something to do with programming.

Comments and Discussions

 
GeneralReason for my vote of 5 Good alternative Pin
ProEnggSoft24-Feb-12 18:53
ProEnggSoft24-Feb-12 18:53 
GeneralReason for my vote of 5 Good one! Pin
Manfred Rudolf Bihy18-Jan-11 12:29
professionalManfred Rudolf Bihy18-Jan-11 12:29 
GeneralReason for my vote of 5 It's good alternate using HTML Agili... Pin
Hiren solanki20-Dec-10 19:24
Hiren solanki20-Dec-10 19:24 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.