Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Duplicate id when setting it using HtmlNode.Id #374

Closed
EdwinStoteler opened this issue Feb 19, 2020 · 3 comments
Closed

Duplicate id when setting it using HtmlNode.Id #374

EdwinStoteler opened this issue Feb 19, 2020 · 3 comments
Assignees

Comments

@EdwinStoteler
Copy link

EdwinStoteler commented Feb 19, 2020

Description

You get Duplicate id when setting it using HtmlNode.Id. This seems to be happening when the node already had an Id and you set a different one.

Fiddle or Project

https://dotnetfiddle.net/OGnU9L

(its giving me an internal server error right now, so here is the code)

                var html = @"<body>
                          <div id=""a""></div>
                </body>";
		var htmlDoc = new HtmlDocument()
		{
			OptionEmptyCollection = true, 
			OptionUseIdAttribute = true
		};
		htmlDoc.LoadHtml(html);
		var htmlBody = htmlDoc.DocumentNode.SelectSingleNode("//body");
		HtmlNode oldChild = htmlBody.ChildNodes[1];
		oldChild.Id = "test";
		Console.WriteLine(oldChild.OuterHtml);

Workarround: dtControl.SetAttributeValue("id", "test")

@JonathanMagnan JonathanMagnan self-assigned this Feb 19, 2020
@JonathanMagnan
Copy link
Member

Weird but that definitely looks like an issue.

My developer will look at it.

Best Regards,

Jon


Performance Libraries
context.BulkInsert(list, options => options.BatchSize = 1000);
Entity Framework ExtensionsEntity Framework ClassicBulk OperationsDapper Plus

Runtime Evaluation
Eval.Execute("x + y", new {x = 1, y = 2}); // return 3
C# Eval FunctionSQL Eval Function

@JonathanMagnan
Copy link
Member

Hello @EdwinStoteler ,

The v1.11.20 has been released.

Could you check it and let us know if everything work as expected now with the id?

@EdwinStoteler
Copy link
Author

Hello @JonathanMagnan ,

The problem seems to be solved, thx for the quick release.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

2 participants