2009-02-09 16:16:11 +00:00
|
|
|
/* Implementation for NSXMLDTDNode for GNUStep
|
|
|
|
Copyright (C) 2008 Free Software Foundation, Inc.
|
|
|
|
|
|
|
|
Written by: Richard Frith-Macdonald <rfm@gnu.org>
|
|
|
|
Created: September 2008
|
|
|
|
|
|
|
|
This file is part of the GNUstep Base Library.
|
|
|
|
|
|
|
|
This library is free software; you can redistribute it and/or
|
|
|
|
modify it under the terms of the GNU Lesser General Public
|
|
|
|
License as published by the Free Software Foundation; either
|
|
|
|
version 3 of the License, or (at your option) any later version.
|
|
|
|
|
|
|
|
This library 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 Lesser General Public
|
|
|
|
License along with this library; if not, write to the Free
|
|
|
|
Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
|
|
|
|
Boston, MA 02111 USA.
|
|
|
|
*/
|
|
|
|
|
2010-02-19 08:12:46 +00:00
|
|
|
#import "common.h"
|
|
|
|
|
2012-01-04 12:41:45 +00:00
|
|
|
#define GSInternal NSXMLDTDNodeInternal
|
2012-01-05 20:40:12 +00:00
|
|
|
#import "NSXMLPrivate.h"
|
|
|
|
#import "GSInternal.h"
|
2012-01-04 12:41:45 +00:00
|
|
|
GS_PRIVATE_INTERNAL(NSXMLDTDNode)
|
|
|
|
|
2009-02-09 16:16:11 +00:00
|
|
|
@implementation NSXMLDTDNode
|
|
|
|
|
|
|
|
- (void) dealloc
|
|
|
|
{
|
2012-01-04 12:41:45 +00:00
|
|
|
if (GS_EXISTS_INTERNAL)
|
|
|
|
{
|
|
|
|
[internal->notationName release];
|
|
|
|
[internal->publicID release];
|
|
|
|
[internal->systemID release];
|
|
|
|
}
|
2009-02-09 16:16:11 +00:00
|
|
|
[super dealloc];
|
|
|
|
}
|
|
|
|
|
|
|
|
- (NSXMLDTDNodeKind) DTDKind
|
|
|
|
{
|
2012-01-04 12:41:45 +00:00
|
|
|
return internal->DTDKind;
|
|
|
|
}
|
|
|
|
|
|
|
|
- (id) initWithKind: (NSXMLNodeKind)kind options: (NSUInteger)theOptions
|
|
|
|
{
|
|
|
|
if (NSXMLEntityDeclarationKind == kind
|
2012-01-04 12:44:29 +00:00
|
|
|
|| NSXMLElementDeclarationKind == kind
|
|
|
|
|| NSXMLNotationDeclarationKind == kind)
|
2012-01-04 12:41:45 +00:00
|
|
|
{
|
|
|
|
/* Create holder for internal instance variables so that we'll have
|
|
|
|
* all our ivars available rather than just those of the superclass.
|
|
|
|
*/
|
|
|
|
GS_CREATE_INTERNAL(NSXMLDTDNode)
|
|
|
|
}
|
|
|
|
return [super initWithKind: kind options: theOptions];
|
2009-02-09 16:16:11 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
- (id) initWithXMLString: (NSString*)string
|
|
|
|
{
|
|
|
|
[self notImplemented: _cmd];
|
|
|
|
return nil;
|
|
|
|
}
|
|
|
|
|
|
|
|
- (BOOL) isExternal
|
|
|
|
{
|
2012-01-04 12:41:45 +00:00
|
|
|
if (internal->systemID != nil)
|
2009-02-09 16:16:11 +00:00
|
|
|
{
|
|
|
|
// FIXME ... libxml integration?
|
|
|
|
return YES;
|
|
|
|
}
|
|
|
|
return NO;
|
|
|
|
}
|
|
|
|
|
|
|
|
- (NSString*) notationName
|
|
|
|
{
|
2012-01-04 12:41:45 +00:00
|
|
|
if (internal->notationName == nil)
|
2009-02-09 16:16:11 +00:00
|
|
|
{
|
|
|
|
[self notImplemented: _cmd];
|
|
|
|
}
|
2012-01-04 12:41:45 +00:00
|
|
|
return internal->notationName;
|
2009-02-09 16:16:11 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
- (NSString*) publicID
|
|
|
|
{
|
2012-01-04 12:41:45 +00:00
|
|
|
if (internal->publicID == nil)
|
2009-02-09 16:16:11 +00:00
|
|
|
{
|
|
|
|
[self notImplemented: _cmd];
|
|
|
|
}
|
2012-01-04 12:41:45 +00:00
|
|
|
return internal->publicID;
|
2009-02-09 16:16:11 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
- (void) setDTDKind: (NSXMLDTDNodeKind)kind
|
|
|
|
{
|
2012-01-04 12:41:45 +00:00
|
|
|
internal->DTDKind = kind;
|
2009-02-09 16:16:11 +00:00
|
|
|
// FIXME ... libxml integration?
|
|
|
|
}
|
|
|
|
|
|
|
|
- (void) setNotationName: (NSString*)notationName
|
|
|
|
{
|
2012-01-04 12:41:45 +00:00
|
|
|
ASSIGNCOPY(internal->notationName, notationName);
|
2009-02-09 16:16:11 +00:00
|
|
|
// FIXME ... libxml integration?
|
|
|
|
}
|
|
|
|
|
|
|
|
- (void) setPublicID: (NSString*)publicID
|
|
|
|
{
|
2012-01-04 12:41:45 +00:00
|
|
|
ASSIGNCOPY(internal->publicID, publicID);
|
2009-02-09 16:16:11 +00:00
|
|
|
// FIXME ... libxml integration?
|
|
|
|
}
|
|
|
|
|
|
|
|
- (void) setSystemID: (NSString*)systemID
|
|
|
|
{
|
2012-01-04 12:41:45 +00:00
|
|
|
ASSIGNCOPY(internal->systemID, systemID);
|
2009-02-09 16:16:11 +00:00
|
|
|
// FIXME ... libxml integration?
|
|
|
|
}
|
|
|
|
|
|
|
|
- (NSString*) systemID
|
|
|
|
{
|
2012-01-04 12:41:45 +00:00
|
|
|
if (internal->systemID == nil)
|
2009-02-09 16:16:11 +00:00
|
|
|
{
|
|
|
|
[self notImplemented: _cmd];
|
|
|
|
}
|
2012-01-04 12:41:45 +00:00
|
|
|
return internal->systemID;
|
2009-02-09 16:16:11 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
@end
|
|
|
|
|