XPATHS and Default Namespaces

You need local-name():

http://www.w3.org/TR/xpath#function-local-name

To crib from http://web.archive.org/web/20100810142303/http://jcooney.net:80/archive/2005/08/09/6517.aspx:

<foo xmlns="urn:foo">
  <bar>
    <asdf/>
  </bar>            
</foo>

This expression will match the “bar” element:

  //*[local-name()='bar'] 

This one won’t:

 //bar

Leave a Comment