XmlDocument.SelectNodes() Selects Nothing!!!!!!! (Part 2)

I thought I better note this down. The reason that SelectNodes() returns an empty list is because a default namespace has been defined on the XmlDocument using the xmlns attribute. As XPath 1.0 doesn’t support default namespaces it means you have to explicitly define a namespace using the XmlNamespaceManager and the XmlDocument.NameTable (see XmlDocument.SelectNodes() Selects Nothing!!!!!!! for example code).

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s