RSSKit
0.6.1
|
00001 /* -*-objc-*- 00002 * 00003 * GNUstep RSS Kit 00004 * Copyright (C) 2006 Guenther Noack 00005 * 00006 * This library is free software; you can redistribute it and/or 00007 * modify it under the terms of the GNU Lesser General Public 00008 * License as published by the Free Software Foundation, in version 2.1 00009 * of the License 00010 * 00011 * This library is distributed in the hope that it will be useful, 00012 * but WITHOUT ANY WARRANTY; without even the implied warranty of 00013 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 00014 * Lesser General Public License for more details. 00015 * 00016 * You should have received a copy of the GNU Lesser General Public 00017 * License along with this library; if not, write to the Free Software 00018 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 00019 */ 00020 00021 #import <Foundation/Foundation.h> 00022 00023 @class XMLNode; 00024 00025 @protocol XMLTextOrNode <NSObject> 00026 -(NSString*) contentAndNextContents; 00027 -(NSString*) content; 00028 -(void) _setNext: (id<XMLTextOrNode>) node; 00029 -(XMLNode*) nextElement; 00030 @end 00031 00032 @interface XMLText : NSObject <XMLTextOrNode> 00033 { 00034 NSString* _content; 00035 id<XMLTextOrNode> _next; 00036 } 00037 00038 -(NSString*) contentAndNextContents; 00039 -(NSString*) content; 00040 -(void) _setNext: (id<XMLTextOrNode>) node; 00041 -(XMLNode*) nextElement; 00042 00043 -(id)init; 00044 -(id)initWithString: (NSString*) str; 00045 00046 -(void)dealloc; 00047 @end 00048 00049 00050 @interface XMLNode : NSObject <XMLTextOrNode> 00051 { 00052 NSString* _name; 00053 NSString* _namespace; 00054 00055 XMLNode* _child; 00056 id<XMLTextOrNode> _next; 00057 00058 id<XMLTextOrNode> _current; 00059 XMLNode* _parent; 00060 00061 NSDictionary* _attributes; 00062 } 00063 00064 -(XMLNode*) firstChildElement; 00065 00066 -(XMLNode*) nextElement; 00067 00068 -(NSString*) name; 00069 00070 -(NSString*) contentAndNextContents; 00071 -(NSString*) content; 00072 00073 -(NSDictionary*) attributes; 00074 00075 -(NSString*) namespace; 00076 00077 -(id) initWithName: (NSString*) name 00078 namespace: (NSString*) namespace 00079 attributes: (NSDictionary*) attributes 00080 parent: (XMLNode*) parent; 00081 00082 -(void) dealloc; 00083 00084 - (void) _setNext: (id <XMLTextOrNode>) node; 00085 00086 - (void) appendTextOrNode: (id<XMLTextOrNode>) aThing 00087 fromParser: (NSXMLParser*) aParser; 00088 00089 @end 00090 00091 @interface XMLNode (NSXMLParserDelegateEventAdditions) 00092 - (void) parser: (NSXMLParser*)aParser 00093 didEndElement: (NSString*)anElementName 00094 namespaceURI: (NSString*)aNamespaceURI 00095 qualifiedName: (NSString*)aQualifierName; 00096 00097 - (void) parser: (NSXMLParser*)aParser 00098 didStartElement: (NSString*)anElementName 00099 namespaceURI: (NSString*)aNamespaceURI 00100 qualifiedName: (NSString*)aQualifierName 00101 attributes: (NSDictionary*)anAttributeDict; 00102 00103 - (void) parser: (NSXMLParser*)aParser 00104 parseErrorOccured: (NSError*)parseError; 00105 00106 - (void) parser: (NSXMLParser*)aParser 00107 foundCharacters: (NSString*)aString; 00108 00109 - (void) parser: (NSXMLParser*)aParser 00110 foundCDATA: (NSData*)CDATABlock; 00111 @end