3

Here is my XML:

<a>
  <a>
    <a stop="">
      <a>
        <b/>
      </a>
    </a>
  </a>
</a>

I need to select element <b> if the path to it doesn't have <a> with @stop. It should be something like this (assume I'm already staying at some <a> in the tree):

a//[not(@stop)]b
kjhughes
  • 106,133
  • 27
  • 181
  • 240
yegor256
  • 102,010
  • 123
  • 446
  • 597

1 Answers1

4

select element <b> if the path to it doesn't have <a> with @stop

I would read that as:

//b[not(ancestor::a/@stop)]
michael.hor257k
  • 113,275
  • 6
  • 33
  • 51