The ‘:’ character, hexadecimal value 0x3A, cannot be included in a name

If you want to use namespaces, LINQ to XML makes that really easy:

XNamespace ab = "http://whatever-the-url-is";
XElement tempElement = doc.Descendants(ab + "test").FirstOrDefault();

Look for an xmlns:ab=... section in your document to find out which namespace URI “ab” refers to.

Leave a Comment