XPath queries without namespace: XSE to the rescue
Note: this entry has moved.
Dare has posted about issues with XPath and namespaces in documents. I'm by no means encouraging this, but if you don't care about namespaces, here's a solution for you.
Using the XSE reader
I proposed (and will upload real soon see the release post), you can setup a handler to catch all elements and remove
any namespaces whatsoever, at reading time (i.e. long before
the document is loaded), as follows:
The Whidbey version looks more compact:
What you effectively get loaded is an infoset without element namespaces, therefore your XPath queries don't need to care about them anymore.
Update: read these follow-up: