W3C home > Mailing lists > Public > www-dom@w3.org > April to June 2001

Re: DocumentTraversal

From: Martijn Pieters <mj@digicool.com>
Date: Tue, 10 Apr 2001 14:32:13 +0200
To: Jeff Winter <Jwinter@zefer.com>
Cc: www-dom@w3.org
Message-ID: <20010410143213.A24578@zopatista.com>
On Tue, Apr 10, 2001 at 09:06:59AM -0400, Jeff Winter wrote:
> 
> 
> Thanks.  But are you saying that this is by convention?  I can't find
> anything in the standard
> that guarantees that such a cast will always work, i.e., the class that
> implements Document will also
> implement DocumentTraversal.
> 
> >>Is there a parser-independent way to obtain a DocumentTraversal interface?
> >>Does this imply that the class implementing the (DOM Level 2) Document is
> >>guaranteed to also support DocumentTraversal?
> >
> > Check hasFeature to find out if the document support the Traversal APIs.
> If
> > it does, you should be able to cast the Document into a DocumentTraversal.
> > (Details of casting are language-dependent, but should be the same for all
> > implementations that share a single language binding.)

If DOMImplementation.hasFeature says that 'Traversal' is implemented, the
cast is guaranteed to work. That's the nature of hasFeature.

-- 
Martijn Pieters
| Software Engineer  mailto:mj@digicool.com
| Digital Creations  http://www.digicool.com/
| Creators of Zope   http://www.zope.org/
---------------------------------------------
Received on Tuesday, 10 April 2001 09:32:27 GMT

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