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

Re: Readonly question

From: Elliotte Rusty Harold <elharo@metalab.unc.edu>
Date: Mon, 11 Feb 2002 11:28:36 -0500
Message-Id: <p04330105b88da0a2aca9@[]>
To: Mark Hellegers <M.H.Hellegers@stud.tue.nl>, <www-dom@w3.org>
At 4:19 PM +0100 2/11/02, Mark Hellegers wrote:
>I'm trying to implement the DOM core api in C++ and I'm not sure what the
>specification means by readonly.
>I read the definition of read only in the glossary, but it still doesn't
>make much sense to me.

When attached to an attribute, e.g.

interface Document : Node {
   // Modified in DOM Level 3:
   readonly attribute DocumentType    doctype;

this means that the specified attribute will have a getter method but 
not a setter method. It does not mean that the internal 
characteristics of that object will not change. In this example this 
means that you cannot change a Document object's doctype to point it 
at a different object. However, you might be able to use methods in 
the DocuemntType class to change the properties of the doctype object 
if they're not also declared to be read-only. (Actually in this case, 
I think they are, so that's a bad example.)

| Elliotte Rusty Harold | elharo@metalab.unc.edu | Writer/Programmer |
|          The XML Bible, 2nd Edition (Hungry Minds, 2001)           |
|              http://www.ibiblio.org/xml/books/bible2/              |
|   http://www.amazon.com/exec/obidos/ISBN=0764547607/cafeaulaitA/   |
|  Read Cafe au Lait for Java News:  http://www.cafeaulait.org/      |
|  Read Cafe con Leche for XML News: http://www.ibiblio.org/xml/     |
Received on Monday, 11 February 2002 11:31:44 UTC

This archive was generated by hypermail 2.3.1 : Tuesday, 20 October 2015 10:46:09 UTC