Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
有没有办法将内联 css 属性从一个节点复制到我将添加到 HtmlAgilityPack 中的新节点?
据我所知,您不能只将一个 HtmlAttributeCollection 分配给另一个,但您可以像这样一个一个地复制它们:
foreach (HtmlAttribute attr in oldNode.Attributes) newNode.Attributes.Add(attr);