In a tree data structure, the root node is a node with no parent, but which typically has children.
Questions tagged [root-node]
36 questions
15
votes
4 answers
PHP5: Find Root Node in DOMDocument
I have a PHP5 DOMDocument and I try to find the root node (not the root element).
Example:
x
x
y
y
…

BlaM
- 28,465
- 32
- 91
- 105
12
votes
2 answers
WPF TreeView bound to ObservableCollection not updating root nodes
Sorry - my question is almost identical to this one but since it didn't receive a viable answer, I am hoping that someone else has some fresh ideas.
I have a WPF TreeView that is bound to a hierarchy of a single type:
public class Entity
{
…

Tim Coulter
- 8,705
- 11
- 64
- 95
12
votes
3 answers
C# Xml serialization, collection and root element
My app serializes objects in streams.
Here is a sample of what I need :
In this case, the object is a collection of 'links' object.
-----------First…

Mose
- 1,781
- 3
- 16
- 35
11
votes
1 answer
What is level of root node in a tree?
Some articles say level of a root node is 0 whereas some say it's 1.
From https://www.gatevidyalay.com/tree-data-structure-tree-terminology/
In a tree, each step from top to bottom is called as level of a tree.
The level count starts with 0 and…

Okokok
- 111
- 1
- 4
4
votes
4 answers
XPath/XQuery: Select a root node with its attributes without childs
I have an xml:
I would like to select ONLY a root node with its attributes without its child nodes:
Is such thing possible with XPath?

Timofey
- 2,478
- 3
- 37
- 53
4
votes
2 answers
wxPython TreeCtrl without showing root while still showing arrows
I am making a python tree visualizer using wxPython. It would be used like so:
show_tree([ 'A node with no children', ('A node with children', 'A child node', ('A child node with children', 'Another child')) ])
It worked fine but it shows a root…

None
- 3,875
- 7
- 43
- 67
3
votes
2 answers
Multiple root nodes in Alpine.js
Building a data table with the latest Alpine.js (v3.7.0).
Ran into a problem when trying to implement child rows (i.e an additional togglable row under the main/parent row).
Simplified version:

Matanya
- 6,233
- 9
- 47
- 80
3
votes
1 answer
Copy XML file contents except for root node and attribute XSLT
I am working on a small XSLT file to copy the contents of an XML file and strip out the declaration and root node. The root node has an namespace attribute.
I currently have it working except for now the namespace attribute is now being copied to…

RXC
- 1,233
- 5
- 36
- 67
3
votes
2 answers
Root immediate child nodes icons not visible when hiding root
I have a JTree structure as shown below. I have Icons that appear whenever a node has child nodes, which is working properly.
My problem is that I need to hide the ROOT node. When I hide the ROOT node, the Icons for MainTop1 and MainTop2 nodes are…

Marquinio
- 4,601
- 13
- 45
- 68
3
votes
5 answers
should a tree have exactly one root node
I want to display a tree structure. Do i really need to give the user/tree a predefined hardcoded root node like "RootUnit" where he can add his children or descendants?
Does this make sense or cause only trouble when adding nodes?

Pascal
- 12,265
- 25
- 103
- 195
2
votes
0 answers
How do I correctly assign my root node to a value?
I am trying to create a Binary Tree from a Hashmap, and in order to do so, I'm trying to assign the root node to a specific Node in the Hashmap, basically the entry which has the entry.getValue() as null.
I have been able to convert my keys into…

Droid
- 520
- 1
- 7
2
votes
1 answer
how to get value of a specified node in XML tree using R language
i have a xml file that includes rootNode and child node with attributes that handle values.
i am using the R language to work on the xml file.
what i need is to display the result of the employees that are in the department IT
how to display the ID…

Ghgh Lhlh
- 155
- 1
- 3
- 14
2
votes
1 answer
Neo4j cypher - Counting immediate children of root nodes
I'm struggling with a problem despite having read a lot of documentation... I'm trying to find my graph root node (or nodes, they may be several top nodes) and counting their immediate children (all relations are typed :BELONGS_TO)
My graph looks…

Romain Bruckert
- 2,546
- 31
- 50
1
vote
1 answer
How to access (PortalSiteMapNode) RootNode outside the SiteMapProvider?
A very simple question for experienced sharepoint developers I think.
Inside a PortalSiteMapProvider I can access the RootNode this way:
(PortalSiteMapNode) RootNode
My Question is, how can I access this node from other places, without a reference…

LMW-HH
- 1,193
- 2
- 15
- 31
1
vote
1 answer
How to add multiple child nodes to a tree
I'm working on a project to create a tree with more than 2 child nodes. I get that when creating a binary tree, we can just create a left node and a right node to act as children, but when I've looked online for help in creating a tree, every…

Arjun Singh
- 103
- 2
- 7