uli-weltersbach / XPathTools

A Visual Studio Extension which can run any XPath and XPath function; navigates through results at the click of a button. Can show and copy any XPath incl. XML namespaces, avoiding XML namespace induced headaches. Keeps track of the current XPath via the statusbar.
41 stars 4 forks source link

Runner to query by simple path when file has a namespace #27

Closed tig2810 closed 6 years ago

tig2810 commented 6 years ago

Hi,

We can query the simple path with 'Copy XPath > last element in the context menu', but if we then paste this into the runner, it will not locate the value in the element when the xml file has a namespace.

2018-05-10_17-59-50

uli-weltersbach commented 6 years ago

Hi

You're explicitly copying the XPath WITHOUT the XMLNS, so the behavior is expected. See https://github.com/uli-weltersbach/XPathTools/wiki/Copying-XPaths#copy-xpath-excl-xmlns for details:

Copy XPath excl. XMLNS

E.g. /packages/package/element-in-custom-namespace. Returns zero(!) or more results.

Copy an XPath which matches the current element or attribute, excluding any XML namespaces.

This feature can be used to communicate an XPath to another human when the XMLNS information is irrelevant.

tig2810 commented 6 years ago

Hi, Yes I understand that, but I dont think it's such a realistic use case. It's also the default for XML Spy as in the screenshot. 2018-05-11_11-24-52

uli-weltersbach commented 6 years ago

The feature was explicitly requested like this, so it's a use case brought on by a concrete business need from other users.

I've never used Altova XML Spy, and I've never aimed at copying the features of other software out there, so if Altova XML Spy works for you, you should stick with that.