Html Agility Pack で、HtmlNode の属性を設定すると、ノードが選択された HtmlDocument にこれが表示されますか?
htmlDocument が HtmlDocument であるとしましょう。したがって、簡略化されたコードは次のようになります。
HtmlNode documentNode = htmlDocument.DocumentNode;
HtmlNodeCollection nodeCollection = documentNode.SelectNodes(someXPath);
foreach(var node in nodeCollection)
if(SomeCondition(node))
node.SetAttributeValue("class","something");
これで、ノード変更のクラス属性が表示されますが、この変更が htmlDocument の html に反映されていません。