XML Parsing with HtmlAgilityPack

azure-worker-roles c# html-agility-pack web-services xml

Question

I'm using HtmlAgilityPack to parse xml on the WebService worker role, however there's a problem. I receive an empty character when I choose a child node. the xml in

<link>
http://www.webtekno.com/google/google-ve-razer-dan-oyun-konsolu.html
</link>

My rss feed get link code is as follows:

HtmlNodeCollection nodeList = doc.DocumentNode.SelectNodes("//item");
foreach (HtmlNode node in nodeList)
{
    string newsUri = node.ChildNodes["link"].InnerText;
}

I believe it is empty since the link node contains a new line and follows the link. How can I add a link to a node?

1
2
7/5/2014 10:54:57 PM

Accepted Answer

Before loading HtmlDocument, insert that line.

HtmlNode.ElementsFlags["link"] = HtmlElementFlag.Closed;

That's it.

Its initial value isHtmlElementFlag.Empty and given the samemeta and img tags...

8
7/5/2014 11:26:42 PM


Related Questions





Related

Licensed under: CC-BY-SA with attribution
Not affiliated with Stack Overflow
Licensed under: CC-BY-SA with attribution
Not affiliated with Stack Overflow