## 29.2 Parsing XML Documents (cont.)

- Parser keeps all white space, by default
- Stored in nodes
- If you didn't mix content, easy to ignore:

- If current element contains elements, skip all non-element child nodes:

  >     for (int i = 0; i < nodes->getLength(); i++)
  >     {
  >        DOMNode* child_node = nodes->item(i);
  >        DOMElement* child_element
  >           = dynamic_cast<DOMElement*>(child_node);
  >        if (child_element != NULL)
  >        {
  >           // Do something with child_element
  >           . . .
  >        }
  >     }

prev |top |next