To check whether the current node matches your description:
self::c[parent::b and not(ancestor::a)]
To select all elements in the document that match your description (or check whether there are any):
//b/c[not(ancestor::a)]
Given a more clearly explained use case, there may be a path that's better suited to your situation, and if so, please let us know. Hopefully the above sets you on the right track.
To check whether the current node matches your description:
To select all elements in the document that match your description (or check whether there are any):
Given a more clearly explained use case, there may be a path that's better suited to your situation, and if so, please let us know. Hopefully the above sets you on the right track.