Hi, Dave,

     Thanks, I noticed that a dom element constructed by
DOM_Element() will compare == to 0 (similar to java's null
object reference variable), this is what I am looking for.


Regards,

Peiyong Zhang
____________________________________________
XML Parsers Development
IBM Toronto Laboratory email: [EMAIL PROTECTED]
Phone: (416)448-4088; Fax: (416)448-4414; T/L: 778-4088



David N Bertoni/CAM/Lotus@Lotus on 03/23/2001 03:26:43 PM

Please respond to [EMAIL PROTECTED]

To:   [EMAIL PROTECTED]
cc:
Subject:  RE: Casting DOM_Node to DOM_Element



How about:

   return DOM_Element();
Dave





                    [EMAIL PROTECTED]

                    bm.com               To:
[EMAIL PROTECTED]
                                         cc:     (bcc: David N
Bertoni/CAM/Lotus)
                    03/23/2001           Subject:     RE: Casting DOM_Node
to DOM_Element
                    09:40 AM

                    Please

                    respond to

                    xerces-c-dev







Hi, Dave,

    I've got a question for you, what shall i do in the 2nd return below?
thanks.

// Finds and returns the first child element node.
DOM_Element XUtil::getFirstChildElement(DOM_Node parent)
{
    // search for node
    DOM_Node child = parent.getFirstChild();
    while (child != 0)
     {
        if (child.getNodeType() == DOM_Node::ELEMENT_NODE)
            return static_cast<DOM_Element&>(child);        /*** 1st return
***/

        child = child.getNextSibling();
    }

    // not found
    return ???       // 2nd return

}


Regards,

Peiyong Zhang
____________________________________________
XML Parsers Development
IBM Toronto Laboratory email: [EMAIL PROTECTED]
Phone: (416)448-4088; Fax: (416)448-4414; T/L: 778-4088


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]





---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]






---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to