2 Copyright (C) 2000-2005 SKYRIX Software AG
4 This file is part of SOPE.
6 SOPE 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 SOPE 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 SOPE; see the file COPYING. If not, write to the
18 Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA
22 #ifndef __DOMAttribute_H__
23 #define __DOMAttribute_H__
25 #include <DOM/DOMNode.h>
28 Why is Attr a Node? Can it have children? Can it be a child?
30 Attr is a Node because its value is actually carried by its children,
31 which may be a mixture of Text and EntityReference nodes, and because
32 making it a Node allows us to store it in a NamedNodeMap for easy retrieval.
34 The getAttribute method hides this detail by returning a string representing
35 the concatenation of all these children, and similarly setAttribute replaces
36 the Attr's contents with a single Text node holding the new string. To create
37 or manipulate other children of an Attr, you have to access the Attr node
38 directly via the getAttributeNode and setAttributeNode methods, or by
39 retrieving it from the element's "attributes" NamedNodeMap.
41 Section 1.1.1 of the Level 1 DOM Recommendation gives a list of which nodes
42 can be parents and children of which other nodes. Attr is not a legal child
43 of any node, so attempts to insert it as one will throw a DOMException
44 (HIERARCHY_REQUEST_ERR).
47 parentNode, nextSibling, previousSibling always return nil !!!
50 @interface NGDOMAttribute : NGDOMNodeWithChildren < DOMAttr >
54 NSString *namespaceURI;
62 @interface NGDOMAttribute(PrivateCtors)
63 /* use DOMDocument for constructing DOMAttributes ! */
65 - (id)initWithName:(NSString *)_name;
66 - (id)initWithName:(NSString *)_name namespaceURI:(NSString *)_uri;
70 @interface NGDOMAttribute(ObjCValues)
72 - (NSString *)stringValue;
74 - (double)doubleValue;
76 @end /* DOMAttribute(Values) */
78 #endif /* __DOMAttribute_H__ */