After loading an XML document, when performing a search for childNodes of particluar element, it gives all the descendants, not just the child nodes

RESOLVED DUPLICATE of bug 26179

Status

()

RESOLVED DUPLICATE of bug 26179
16 years ago
11 years ago

People

(Reporter: jmplun, Unassigned)

Tracking

Trunk
x86
Windows XP
Points:
---

Firefox Tracking Flags

(Not tracked)

Details

(Reporter)

Description

16 years ago
User-Agent:       Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; .NET CLR 1.0.3705)
Build Identifier: Mozilla 1.3.1

If I load an Xml document, and pull out a particular element. If I then use
myElement = element.childNodes;

It will return to me all descendent nodes, not just child nodes. 
ie if I had
<Parent>
   <Title> SomeText </Title>
<Parent>

it will tell me I have two child nodes, when by w3c spec, the Text Node is 
actually the child of the Title Node ( or grandchild of Parent)

Reproducible: Always

Steps to Reproduce:
1.load document
2.searchForelementByTagName
3.getChildNodes
4.Look at results

Actual Results:  
I get all the descendant nodes


Expected Results:  
I only want the child nodes
There is a #text node inside <parent> but before the <title> node... (look at
the DOM in DOM inspector, and make sure display of whitespace-only nodes is
enabled).

*** This bug has been marked as a duplicate of 26179 ***
Status: UNCONFIRMED → RESOLVED
Last Resolved: 16 years ago
Resolution: --- → DUPLICATE

Updated

11 years ago
Component: DOM: Core → DOM: Core & HTML
QA Contact: desale → general
You need to log in before you can comment on or make changes to this bug.