Re: Readonly question

At 4:19 PM +0100 2/11/02, Mark Hellegers wrote:
>Hello,
>
>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