Great library!

May 3, 2011 at 10:58 AM
Edited May 3, 2011 at 11:32 AM

Thanks for this very useful library! - although I have to admit I'm only using a portion of it to do html normalization.

Just one comment about the Normalize method. It seems that if the input html is too condensed (i.e. no line-breaks or CRLFs) then the routine regularly breaks with errors like 'The reference node is not a child of this node.'. By simply doing a .Replace("><", ">\r\n<") on the input string seems to magically sort out the problem.

.Replace("><", ">\r\n<");
Coordinator
May 3, 2011 at 1:56 PM

Hello Rudolf,

Thanks for the comment; it's really appreciated.

The parser should not choke like that on line breaks, so what you're experiencing may be a bug. Can you send sample html so that I can create a unit test for it.

Regards,

Shawn K. Lewis

May 3, 2011 at 5:35 PM
Edited May 3, 2011 at 6:33 PM

hi, I discovered the issue while testing an HTMLWriter library I'm creating. A sample html would be

----------------

<html>
<head>
<title>Test</title>
<link rel="stylesheet" type="text/css" href="somesheet.css" />
<style type="text/css">
body
{font-family:Arial;}
.blue
{background-color:lightblue;}
.red
{background-color:#CAA;}
.green
{background-color:lightgreen;}
.fullWidth
{width:100%;}
.alignleft
{text-align:left;}

</style>
</head>
<body>
<h1>Example</h1><hr /><table class="fullWidth"><tr><th class="alignleft">Name</th><th class="alignleft">Surname</th></tr><tr class="blue"><td>Piet</td><td>Pompies</td></tr><tr class="red"><td>Koos</td><td>Pompies</td></tr><tr class="green"><td>Jan</td><td>Pompies</td></tr><tr class="blue"><td>Piet</td><td>van der Merwe</td></tr><tr class="red"><td>Koos</td><td>van der Merwe</td></tr><tr class="green"><td>Jan</td><td>van der Merwe</td></tr></table><hr />
<blockquote><table class="main" border="0"><tr><th>Name</th><th>Surname</th></tr><tr><td colspan="2">test2</td></tr></table></blockquote>
<p class="stuff">Hello lion</p><p>Some more text.<br /><a href="example.htm">Back to myself</a></p><ul class="mylist"><li>Item 1</li><li>Item 2</li><li>Item 3</li></ul>
</body>
</html>
----------------

I hope the carriage returns come through (as formatted by the email). Otherwise, please give me an email address that I can send a file as an attachment.

Regards

Rudolf

On Tue, May 3, 2011 at 3:56 PM, kurtnelle <notifications@codeplex.com> wrote:

From: kurtnelle

Hello Rudolf,

Thanks for the comment; it's really appreciated.

The parser should not choke like that on line breaks, so what you're experiencing may be a bug. Can you send sample html so that I can create a unit test for it.

Regards,

Shawn K. Lewis

Read the full discussion online.

To add a post to this discussion, reply to this email (systemhtml@discussions.codeplex.com)

To start a new discussion for this project, email systemhtml@discussions.codeplex.com

You are receiving this email because you subscribed to this discussion on CodePlex. You can unsubscribe on CodePlex.com.

Please note: Images and attachments will be removed from emails. Any posts to this discussion will also be available online at CodePlex.com