Productivity Hint 29.1 (cont.)


ClassForElement getElementName(DOMNode* e)
{
   DOMNodeList* children = e->getChildNodes();
   for (int i = 0; i < children->getLength(); i++)
   {
      DOMNode* child_node = children->item(i);
      DOMElement* child_element
         = dynamic_cast<DOMElement*>(child_node);
      if (child_element != NULL)
      {
         Get value of child element
      }
   }
   Use the child element values to construct and
   return a ClassForElement object
}

prev |top |next