سؤال

What's the difference between preceding:: and ancestor:: in XPath 2.0?

هل كانت مفيدة؟

المحلول

The preceding:: axis contains all the nodes in the document that come before this node, excluding this node's ancestors, which are in the ancestor:: axis. For example, in this document:

<a>
  <b>
    <c/>
  </b>
  <d>
    <e/>
  </d>
</a>

The "preceding" nodes of e would be b and c, but not a and d as they are e's ancestors. Make sense?

(source)

مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top