1
Vote

Default namespace support

description

I was able to open a document with a default namesapce, but teh namespace was not visible anywhere in the document view and XPath seemed broken. Clicking on "Edit -> Copy Node XPath to Address Bar" puts an XPath in the address bar that does not work due to the namespace. Removing the default namespace resolves the problem, but this is far from optimal.

Default namespace example:

<?xml version="1.0" encoding="utf-8"?>
<XML_FILE xmlns="urn:foo">
<BAR>
.
.
.
</BAR>
</XML_FILE>

comments

jcoon wrote Apr 24, 2015 at 8:38 PM

Yeah, unfortunately, the way the .NET Framework handles default namespaces is not ideal. The best solution I could come up with is the Namespaces tab. You should notice in the Namespaces tab that your default namespace is automatically given a prefix of 'default', and there's a note that you'll have to use it in any XPath statements. So these should work:

/default:XML_FILE//default:XML_FILE/default:BAR