2

I wrote:

It’s supposed that the immediate ancestor of two nodes is one or few levels up from the current node in the DOM-tree.

The context is an HTML document, but you can consider the tree any tree consisting of some nodes. I want to know if I used one or few levels up from the current node correctly? I mean if "level" takes the "up" and "from" prepositions in this case.

3
  • "Of two nodes" looks a bit odd. Do you mean "of any two nodes" or "of the two nodes"? Dec 27, 2016 at 14:26
  • @CowperKettle yes, it was actually any two handles where each handle corresponds to one node, one of which is the current node
    – Ahmad
    Dec 27, 2016 at 14:48
  • 1
    I would then include the word "any", because otherwise "two nodes" looks odd. Dec 27, 2016 at 14:54

1 Answer 1

1

Yes it works although it helps if you define your context first in terms of parent and child nodes. For example:

You need to parse the parent node for relevant data, or if that does not exist, go one level up and parse the node tree from the parent of the parent.

You can also refer to a "higher" or "lower" node, although again context is important to make sure this isn't confused with nodes that are higher or lower in the array of children under a particular node.

In general, to avoid confusion altogether you can use standard XML-type notation. Then you don't have to worry about what the words are in English, as the sentence will be understood by anyone.

Finally the "highest" node in an XML structure (like the DOM) is called the root node, but you probably already knew that :)

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .