You can use this public xml library and then get the value with:
XElement root = XElement.Load(file); // or .Parse(string)
string href = root.XGetElement<string>("//a:link[@rel={0}]/href", null, "next");
if(null != href)
... link was found ...
That should work with the a:link
, but if it doesn't try it without the a:
. It would depend on where a's namespace was declared. If it is in the root node it should be fine.
XGetElement()
is basically a combination of XPathElement("//a:link[@rel={0}]").Get<string>("href", null)
. Get()
also being a part of the library for getting values from nodes, checking first for an attribute by the name and then for a child node.