2 Copyright (C) 2000-2004 SKYRIX Software AG
4 This file is part of OpenGroupware.org.
6 OGo is free software; you can redistribute it and/or modify it under
7 the terms of the GNU Lesser General Public License as published by the
8 Free Software Foundation; either version 2, or (at your option) any
11 OGo is distributed in the hope that it will be useful, but WITHOUT ANY
12 WARRANTY; without even the implied warranty of MERCHANTABILITY or
13 FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
14 License for more details.
16 You should have received a copy of the GNU Lesser General Public
17 License along with OGo; see the file COPYING. If not, write to the
18 Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA
23 #ifndef __DOMAttribute_H__
24 #define __DOMAttribute_H__
26 #include <DOM/DOMNode.h>
29 Why is Attr a Node? Can it have children? Can it be a child?
31 Attr is a Node because its value is actually carried by its children,
32 which may be a mixture of Text and EntityReference nodes, and because
33 making it a Node allows us to store it in a NamedNodeMap for easy retrieval.
35 The getAttribute method hides this detail by returning a string representing
36 the concatenation of all these children, and similarly setAttribute replaces
37 the Attr's contents with a single Text node holding the new string. To create
38 or manipulate other children of an Attr, you have to access the Attr node
39 directly via the getAttributeNode and setAttributeNode methods, or by
40 retrieving it from the element's "attributes" NamedNodeMap.
42 Section 1.1.1 of the Level 1 DOM Recommendation gives a list of which nodes
43 can be parents and children of which other nodes. Attr is not a legal child
44 of any node, so attempts to insert it as one will throw a DOMException
45 (HIERARCHY_REQUEST_ERR).
48 parentNode, nextSibling, previousSibling always return nil !!!
51 @interface DOMAttribute : DOMNodeWithChildren < DOMAttr >
55 NSString *namespaceURI;
63 @interface DOMAttribute(PrivateCtors)
64 /* use DOMDocument for constructing DOMAttributes ! */
66 - (id)initWithName:(NSString *)_name;
67 - (id)initWithName:(NSString *)_name namespaceURI:(NSString *)_uri;
71 @interface DOMAttribute(ObjCValues)
73 - (NSString *)stringValue;
75 - (double)doubleValue;
77 @end /* DOMAttribute(Values) */
79 #endif /* __DOMAttribute_H__ */