/usr/include/GNUstep/XMLLib/XMLNode.h is in adun.app 0.81-6.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 | /*
Project: XMLLib
Copyright (C) 2005 Michael Johnston & Jordi Villa-Freixa
Author: Michael Johnston
Created: 2005-06-06 13:57:55 +0200 by michael johnston
This application is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public
License as published by the Free Software Foundation; either
version 2 of the License, or (at your option) any later version.
This application is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Library General Public License for more details.
You should have received a copy of the GNU General Public
License along with this library; if not, write to the Free
Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111 USA.
*/
#ifndef _XMLNODE_H_
#define _XMLNODE_H_
#include <Foundation/Foundation.h>
/**
An instance of XMLNode represents a node in an XML file.
*/
@interface XMLNode : NSObject
{
NSMutableArray* children;
NSDictionary* attributes;
id parent;
NSString* name;
NSString* status;
NSString* fieldValue;
int childCount;
int index;
int level;
}
/**
Delegate method for NSXMLParser. When NSXML parser encounters the start of an XML tag it sends this
message to whoever is its delegate at the time.
\param parser The NSXML parser instance that sent the message
\param elementName The name of the element whose start tag was encountered
\param namespaceURI the namespaceURI of this element (not implemented)
\param qualifiedName The full path name of the element (I think. Also not implemented)
\param attributeDict The attributes of the tag
*/
- (void) parser: (id) parser didStartElement: (NSString *) elementName namespaceURI: (NSString *) namespaceURI qualifiedName: (NSString *) qualifiedName attributes: (NSDictionary *) attributeDict;
/**
Delegate method for NSXMLParser. When NSXML parser encounters the end of an XML tag it sends this
message to whoever is its delegate at the time.
\param parser The NSXML parser instance that sent the message
\param elementName The name of the element whose end tag was encountered
\param namespaceURI the namespaceURI of this element (not implemented)
\param qName The full path name of the element (I think. Also not implemented)
*/
-(void) parser: (id) parser didEndElement: (NSString *)elementName namespaceURI:(NSString * )namespaceURI qualifiedName: (NSString *) qName;
/**
Delegate method for NSXMLParser. When NSXML parser encounters any CDATA it sends this
message to whoever is its delegate at the time.
\param parser The NSXML parser instance that sent the message
\param string A string containing the characters that were found.
*/
-(void) parser: (NSXMLParser *) parser foundCharacters: (NSString *) string;
/**
Returns an XMLNode object with the specified tag name, attributes, and children. Specify nil in the children and attributes parameters if there are no attributes
or children to add to this node object.
\param elementName The name of the XML element
\param chidren An NSMutableArray of child nodes (each of whoms parents must be this node)
\param attributes An NSDictionary containing node attributes
\return An initialised XMLNode instance
*/
+ (id) elementWithName: (NSString*) elementName children: (NSMutableArray*) children attributes: (NSDictionary*) attributes;
/**
Returns the index of this node which identifies its poistion relative to its siblings. The first child has an index of 0
*/
- (int) index;
/**
Returns the nesting level of the receiver within the tree hierarchy. The root element of a document has a nesting level of one.
*/
- (int) level;
/**
Returns the XML element name of the receiver i.e. the element type
*/
-(NSString*) name;
/**
Returns the recievers fieldValue or nil if it has none
*/
- (NSString*) fieldValue;
/**
Returns the child node of the receiver at the specified index. If the receiver has no children, this method returns nil.
If index is out of bounds, an exception is raised.
*/
- (id) childAtIndex: (int) childNo;
/**
Returns the number of child nodes the receiver has.
For performance reasons, use this method instead of getting the count from the array returned by children
(for example, [[thisNode children] count]).
\note cache the number of childre
*/
- (int) childCount;
/**
Returns an immutable array containing the child nodes of the receiver.
*/
- (NSArray*) children;
/**
Returns the next XMLNode object in document order. You use this method to walk forward through the tree structure representing an XML document or
document section. (Use previousNode to traverse the tree in the opposite direction.)
Document order is the natural order that XML constructs appear in markup text.
If you send this message to the last node in the tree, nil is returned. XMLNode bypasses namespace and attribute nodes when
it traverses a tree in document order.
*/
- (id) nextNode;
/**
Returns the next XMLNode object that is a sibling node to the receiver. This object will have an index value that is one more than the receiver’s.
If there are no more subsequent siblings (that is, other child nodes of the receiver’s parent) the method returns nil.
*/
- (id) nextSibling;
/**
Returns the parent node of the receiver. Document nodes and standalone nodes (that is, the root of a detached branch of a tree) have no parent,
and sending this message to them returns nil. A one-to-one relationship does not always exists between a parent and its children;
although a namespace or attribute node cannot be a child, it still has a parent element.
*/
- (id) parent;
/**
Returns the previous XMLNode object in document order. You use this method to walk backward through the tree structure representing an
XML document or document section. (Use nextNode to traverse the tree in the opposite direction.) Document order is the natural order that XML
constructs appear in markup text. If you send this message to the first node in the tree (that is, the root element),
nil is returned.
** Not Implemented **
*/
- (id) previousNode;
/**
Returns the previous NSXMLNode object that is a sibling node to the receiver. This object will have an index value that is one less
than the receivers. If there are no more previous siblings (that is, other child nodes of the receiver’s parent) the method returns nil
** Not Implemented **
*/
- (id) previousSibling;
/**
Detaches the receiver from its parent node. Once the node object is detached, you can add it as a child node of another parent.
** Not Implemented **
*/
- (void) detach;
/**
Returns the recievers attributes
*/
- (NSDictionary*) attributes;
/**
Returns a new initialised node for elementName. XMLNode instances use this method to create their children. In this case
it returns a new XMLNode instance. Subclasses of XMLNode can override this method so when they create their children something other
than an XMLNode instance will be returned. This method avoids having to directly name a class when creating a new child.
*/
- (id) nodeForElementName: (NSString*) elementName children: (NSArray*) childArray attributes: (NSDictionary*) attributeDict;
@end
#endif // _XMLNODE_H_
|