Wrox Programmer Forums
Go Back   Wrox Programmer Forums > C# and C > C# 2008 > C# 2008 aka C# 3.0
|
C# 2008 aka C# 3.0 Discuss the Visual C# 2008 (aka C# 3.0) language
Welcome to the p2p.wrox.com Forums.

You are currently viewing the C# 2008 aka C# 3.0 section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old June 27th, 2008, 10:21 AM
Authorized User
 
Join Date: Dec 2006
Posts: 35
Thanks: 0
Thanked 0 Times in 0 Posts
Default Remove orphaned html elements from html string

Hi,

Does anybody have any thoughts on how I might remove orphaned html elements from a string of html?

The string might be quite long.

I am trying to parse html content for output in an RSS feed and am getting stuck because there are orphaned html elements, like an open <strong> element with no closing element, all over the place.

Any help would be much appreciated. Thanks.
__________________
http://www.thewebsiteshop.co.uk
 
Old June 27th, 2008, 10:23 AM
samjudson's Avatar
Friend of Wrox
 
Join Date: Aug 2007
Posts: 2,128
Thanks: 1
Thanked 189 Times in 188 Posts
Default

The method people usually mention is using one of the many *Tidy clones (e.g. JTidy, HtmlTidy etc).

/- Sam Judson : Wrox Technical Editor -/
 
Old June 30th, 2008, 09:40 AM
Authorized User
 
Join Date: Dec 2006
Posts: 35
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Great, thanks.

I used http://sourceforge.net/projects/tidynet/ using this example http://bytes.com/forum/post2264369-2.html





Similar Threads
Thread Thread Starter Forum Replies Last Post
Implement HTML elements in my template with Zend snowbydave1 PHP How-To 0 October 25th, 2008 02:00 AM
remove duplicate text in an output html element mrame XSLT 1 June 20th, 2008 01:41 AM
display out of order html elements? chobo XSLT 2 April 1st, 2008 02:28 AM
Using xml elements as html attributes chipmaster XSLT 4 June 26th, 2007 10:22 AM
remove html tags lucian Dreamweaver (all versions) 1 November 14th, 2004 03:25 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.