Pourquoi ne reçois-je aucun résultat en utilisant le code XML et XPath ci-dessous?La requête XPath ne renvoie aucun résultat
C'est en fait PowerShell mais je l'ai aussi essayé avec this online tool mais encore une fois: il ne sort rien!
Je pense que je suis totalement négliger quelque chose!
[xml] $xml = @"
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup Label="ProjectConfigurations">
<ProjectConfiguration Include="Debug|AnyCPU">
<Configuration>Debug</Configuration>
<Platform>AnyCPU</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Debug|ARM">
<Configuration>Debug</Configuration>
<Platform>ARM</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Debug|x64">
<Configuration>Debug</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Debug|x86">
<Configuration>Debug</Configuration>
<Platform>x86</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|AnyCPU">
<Configuration>Release</Configuration>
<Platform>AnyCPU</Platform>
</ProjectConfiguration>
</ItemGroup>
</Project>
"@;
Select-Xml "//ItemGroup" $xml | % {
Write-Host $_.Node.GetType();
}
Vous surplomberez l'espace de noms. – choroba