Questions tagged [siblings]

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
732 questions
5
votes
3 answers

XSLT merging/concatenating values of siblings nodes of same name into single node

Input xml abc aaa bbb ccc cde
user1677271
  • 67
  • 1
  • 1
  • 6
5
votes
1 answer

xsl - last preceding sibling

I am stuck with a logic related to preceding sibling, Trying to keep XML simple .…
Sr7
  • 341
  • 1
  • 10
  • 19
5
votes
5 answers

jquery count siblings does not return correct result?

I want to count the sibling by classes, html,
1
2
3
Run
  • 54,938
  • 169
  • 450
  • 748
4
votes
4 answers

jquery: How can I add an item before the siblings?

How can I add an item before the siblings? For instance,
1
2
3
So I want to add this item before of them.
0
This one does not work of course! $('
Run
  • 54,938
  • 169
  • 450
  • 748
4
votes
2 answers

Dojo get next sibling based on current event target

I have this dropdown menu, and all i want to do is upon firing the onmouseenter event, to change the border-left of the targets next sibling to white. So far i can address the currentTarget's border-left with ease, but i cant find a way to do the…
mfreitas
  • 2,395
  • 3
  • 29
  • 42
4
votes
3 answers

JQuery - Scrolling list, increase font-size gradually

  • 1
  • 2
  • 3
  • 4
$(document).ready(function() { function scroll() { $('#wrap ul li:first').slideUp(function() { $(this).show().parent().append(this); }); } …
oceansmoving
  • 155
  • 12
4
votes
3 answers

How to select all previous siblings of element using jquery?

Let's say I have a div with next content:

one

two

three

So is there any way to remove first three elements? I don't know the number of elements. I just…
Luka Krajnc
  • 915
  • 1
  • 7
  • 21
4
votes
2 answers

MySQL: Get direct siblings of the row

I have problem to select direct siblings of the main row. For example this is my data I need to filter: +------+------------+------------+ | id | from | to | +------+------------+------------+ | 2265 | 2016-03-30 | 2016-04-09 | |…
p3le
  • 49
  • 10
4
votes
1 answer

Setting different margin to the li first child based on the number of list elements

I'm trying to set a different CSS margin value to the first element of LI in UL depending on the number of LI elements. i.e
  • (margin: 20%)
  • (margin: 40%)
Tried with :nth-last-child(n + 3) but it…
Rani Einav
  • 43
  • 4
4
votes
2 answers

AngularJS Transition to sibling of abstract state from sibling

I have been working with angular-ui-router and trying to transition to a child of one of my abstract states from within another child of the same abstract. this diagram shows the Idea a bit better: So where 'R' is say the module and 'blue 1' is my…
Eolis
  • 645
  • 2
  • 9
  • 22
4
votes
3 answers

Find if node has siblings using simplexml

I am try to find if a certain node has siblings, and if it does, I would like to know what those siblings are. Is this possible?
Nic Hubbard
  • 41,587
  • 63
  • 251
  • 412
4
votes
2 answers

How can I wrap each element and all its siblings before the next occurrence of the same element?

I've got some markup that's similar to the following:

A Heading

Here is a paragraph.

  • First
  • Second
Here's some other block-level element

The Wrapping Should…

Curtis Blackwell
  • 3,130
  • 3
  • 27
  • 45
4
votes
1 answer

How do I use strong and weak with sibling objects (either can be the parent) in Objective-C ARC?

I have two Objective-C objects that relate to each other in some way. You may think of this as a two-way relationship. With ARC, I understand that the parent should hold a strong reference to its child object, while the child holds a weak…
4
votes
1 answer

Use jquery closest() to find closest element with a known sibling

I am trying to use the jquery closest command to find a particular element based on if the element has a particular sibling. I have been playing with different selectors but haven't been able to find one yet that does what I want. So for example, if…
bbeaudet
  • 43
  • 2
4
votes
2 answers

Remove closest empty siblings

Let's say I have the following markup:

not empty

not empty

// more content inside

<-- whitespace, also removed

not empty

How do I remove the empty

tags…

qwerty
  • 5,166
  • 17
  • 56
  • 77