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...

BobTheBuilder
  • 2,455
  • 2
  • 27
  • 39

1 Answers1

2

This should work:

//HintPath[not(starts-with(text(),'..\packages\'))]
Jens Erat
  • 37,523
  • 16
  • 80
  • 96
hannestu
  • 44
  • 3