W3C home > Mailing lists > Public > www-dom@w3.org > January to March 1999

example error??

From: Martin Honnen <Martin.Honnen@sector27.de>
Date: Sat, 9 Jan 1999 13:52:15 -0500 (EST)
Message-ID: <3697B1B4.5E159207@sector27.de>
To: www-dom@w3.org
http://www.w3.org/TR/WD-DOM-Level-2/filters-and-iterators.html
contains the following example supposed to filter out named anchors in an HTML
document:

class NamedAnchorFilter implements NodeFilter
            {
                boolean acceptNode(Node n) {
                    if (n instanceof Element) {
                        Element e = n;
                        if (n.getAttribute("NAME") != NULL) {
                            return true;
                        }
                    }
                    return false;
                }
            }


Shouldn't that be
  n instanceof HTMLAnchorElement
to do what it is supposed to do?? 
-- 

	Martin Honnen

	Email: mailto:Martin.Honnen@sector27.de
	WWW  : http://www.sector27.de/martin.honnen/
Received on Monday, 11 January 1999 13:08:11 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Friday, 22 June 2012 06:13:46 GMT