Questions tagged [descendant]

Descendant of a vertex v, in the tree data structure, refers to a vertex that is either a child of v or recursively a descendant of any of the children of v.

A tree, in graph theory, is an undirected graph which has a unique path between any pair of vertices. A tree is called rooted, if one particular vertex is assigned as the root.

A rooted tree induces a partial order, where the root is at the highest level, each vertex connected to the root via an edge are called its children. This hierarchy may continue further down, with each vertex having children of its own.

A descendant of any vertex is, therefore, any vertex that can be reached by traversing from parent to child.

132 questions
4
votes
2 answers

XElement.Descendants () make it case-insensitive

XElement.Descendants () method accepts name of element to be find. But it is case-sensitive is there any way to make it case-insensitive
donstack
  • 2,557
  • 3
  • 29
  • 44
4
votes
2 answers

xpath /descendant-or-self - Searching for a node in a particular tree

I am reading about the short-cut, '//', which apparently is a shortcut for: '/descendant-or-self' it is clear what to expect, say, from a simple example of such an expression, eg, //myNode It will return a node list of all instances in the…
svaens
  • 649
  • 7
  • 23
3
votes
1 answer

Why //descendant is evaluating siblings as well in this XSLT template?

I am curious why this XSLT :
Mary
  • 43
  • 5
3
votes
5 answers

JQuery selector help

Using JQuery, how do I select all elements with class x within an element with id y?
dmr
  • 21,811
  • 37
  • 100
  • 138
3
votes
3 answers

xpath descendant and descendant-or-self work completely different

I try to find all seconds tds among the descendants of div with the specified id, i.e. 22 and 222. The first solution that comes to my mind was: //div[@id='indicator']//td[2] but it selects only the first table cell, i.e. 22 but not both 22 and…
3
votes
3 answers

How to get all descendants of a node with Django treebeard?

Let's say I have these Models: class Category(MP_Node): name = models.CharField(max_length=30) class Item(models.Model): category = models.ForeignKey(Category) and I would like to find all Items belonging to any descendant of a given…
Alex Rothberg
  • 10,243
  • 13
  • 60
  • 120
2
votes
3 answers

JavaScript/jQuery: hasDescendant / hasAncestor

Hilariously, I'm having incredible difficulty finding any half-good way to determine whether or not an HTML element is inside another one or not -- which seems like it should be a basic core feature of traversing and analyzing the HTML DOM. I was…
ChaseMoskal
  • 7,151
  • 5
  • 37
  • 50
2
votes
1 answer

How do I access direct descendants of a jquery object cleanly?

I have the following line in my js var description = jqref.children('.category_info').children('.description').children('p').html(); which works exactly how I want it, though to me it feels way too clunky which feels like I am overlooking a better…
Zak Henry
  • 2,075
  • 2
  • 25
  • 36
2
votes
1 answer

jQuery reports no direct descendants of document

I'm using jQuery 1.6.1 at the moment. In Firebug, I've seen that this: console.log($(document).find("*")) does what I expect; it returns all the children of the document. But this: console.log($(document).find("> *")) does not. It returns an…
dnuttle
  • 3,810
  • 2
  • 19
  • 19
2
votes
1 answer

Find all descendants in array

At first look it was a simple task, but when I tried to solve it I became confused. I have PHP array, where keys are top parent IDs, values are child IDs. Some child IDs have their own children. That children may have own children and so on. My goal…
Stepasyuk
  • 49
  • 5
2
votes
1 answer

MDX Get Descendants of Named Set

I'm looking to return all leaf descendants of a named set in MDX. The set contains the following members: CREATE SET [Time].[Quarter].[ActiveBudget_Qtr] AS '{[Time].[Default].&[2020Q3], [Time].[Default].&[2020Q4], …
Luke_0
  • 779
  • 5
  • 20
2
votes
1 answer

XPath Select parent node based on child node

I need to extract the href where its descendant is: i/[@class="icon-right-open rotate180"] I tried the following but it didn't work for me //a[@class="arrowDot "]/@href /descendant::i[@class="icon-right-open rotate180"] here is the HTML CODE:
user3729357
  • 161
  • 7
2
votes
2 answers

Xpath query to find nodes whose descendants contain particular text

Been lurking here for a long time, but I needed to ask this. Please excuse my noobity. Doing some PHP/Xpath coding for some scraping, and I want to know an XPath expression to select nodes which have a parent whose sibling, somewhere in their…
2
votes
1 answer

How to exclude undesired descendants?

I have a situation where an element contains n clickable handles and n revealable elements:
A

Content A.

danjah
  • 2,939
  • 2
  • 30
  • 47
2
votes
1 answer

How to get all childs of a node using php xpath?

In the code below: header 1 11 12 header 2 21 22 When I run,…
fractal5
  • 2,034
  • 4
  • 29
  • 50
1
2
3
8 9