The term "sibling" refers to a kind of relationship between two items in a tree structure. Two items have the sibling relationship if they both have the same parent.
The term "sibling" refers to a kind of relationship between two items in a tree structure. Two items have the sibling relationship if they both have the same parent. The sibling relationship is most commonly used in reference to elements in document model objects (DOM's) such as XML documents or HTML documents.
In XPath, a language used to address and locate parts of an XML document, the sibling relationship is directly supported by two axis:
- following-sibling axis refers to all the following siblings of the context node, and
- preceding-sibling axis refers to all the preceding siblings of the context node
In addition, two more XPath axis support the sibling concept indirectly:
- the following axis and
- the preceding axis