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

Investigate potential XMLNS issue #19

Closed uli-weltersbach closed 6 years ago

uli-weltersbach commented 6 years ago

"Copy distinct XPath" returns an XPath which causes an error for the dependentAssembly element, when the XPath is run via the XPath Runner (although it seems to be valid).

Note the "double" definition of xmlns on the assemblyBinding element:

<configuration xmlns:xdt="http://schemas.microsoft.com/XML-Document-Transform">
  <runtime>
    <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1" xmlns:urn="urn:schemas-microsoft-com:asm.v1">
      <dependentAssembly xdt:Transform="Replace" xdt:Locator="XPath(/configuration/runtime//*[local-name()='assemblyIdentity' and @name='Newtonsoft.Json']/..)">
        <assemblyIdentity name="Newtonsoft.Json" publicKeyToken="30ad4fe6b2a6aeed" />
        <bindingRedirect oldVersion="0.0.0.0-6.0.0.0" newVersion="6.0.0.0" />
      </dependentAssembly>
    </assemblyBinding>
  </runtime>
</configuration>

Some help may be found at https://msdn.microsoft.com/en-us/library/ms950779.aspx.

uli-weltersbach commented 6 years ago

Issue lies in the XPathWorkbench (XPath Runner), which doesn't properly handle XML namespace prefixes.