0

I'm looking for an XPath statement to query for all parents that have a specific child where the child's inner text doesn't contain a specified value:

<Project>
  <ItemGroup>
    <Reference Include="NHibernate">
      <HintPath>..\packages\......</HintPath>
    </Reference>
  </ItemGroup>
</Project>

So I want all the reference nodes that have the HintPath child node only where the path specified in the HintPath doesn't start with "..\packages\"

I can already use //x:Reference[x:HintPath] to get the Reference nodes that contain the HintPath node... I just can't figure out the last bit of the chain...

4

1 回答 1

2

这应该有效:

//HintPath[not(starts-with(text(),'..\packages\'))]
于 2013-06-17T20:53:19.697 回答