Don't assume that Document.getFirstChild is any particular kind of node. The DocumentType node may preceed the document's root element, if present. There may also be comments or PIs preceeding or following the root element. And in some DOMs, there may be a node for the XML Declaration, if you're working in XML. If you want to retrieve the root node (<HTML>, in your case), the best solution is to use the call specifically designed for that purpose -- Document.getDocumentElement(). Second best is to walk through the Document's children looking for a node whose type is Element. ______________________________________ Joe Kesselman / IBM ResearchReceived on Monday, 10 July 2000 12:49:13 GMT
This archive was generated by hypermail 2.2.0+W3C-0.50 : Tuesday, 27 October 2009 08:24:52 GMT