mirror of
https://github.com/gnustep/libs-base.git
synced 2025-05-30 00:11:26 +00:00
Implement -[NSXMLParser initWithStream:].
This commit is contained in:
parent
dcfe2a2ce3
commit
5dfda50d82
7 changed files with 154 additions and 43 deletions
|
@ -480,16 +480,11 @@ static NSNull *null = nil;
|
|||
|
||||
- (id) initWithContentsOfURL: (NSURL*)anURL
|
||||
{
|
||||
NSData *d = [NSData dataWithContentsOfURL: anURL];
|
||||
|
||||
if (d == nil)
|
||||
{
|
||||
DESTROY(self);
|
||||
}
|
||||
else
|
||||
{
|
||||
self = [self initWithData: d];
|
||||
}
|
||||
_handler = [NSXMLSAXHandler new];
|
||||
[myHandler _setOwner: self];
|
||||
_parser = [[GSXMLParser alloc] initWithSAXHandler: myHandler
|
||||
withContentsOfURL: anURL];
|
||||
[(GSXMLParser*)_parser substituteEntities: YES];
|
||||
return self;
|
||||
}
|
||||
|
||||
|
@ -497,7 +492,18 @@ static NSNull *null = nil;
|
|||
{
|
||||
_handler = [NSXMLSAXHandler new];
|
||||
[myHandler _setOwner: self];
|
||||
_parser = [[GSXMLParser alloc] initWithSAXHandler: myHandler withData: data];
|
||||
_parser = [[GSXMLParser alloc] initWithSAXHandler: myHandler
|
||||
withData: data];
|
||||
[(GSXMLParser*)_parser substituteEntities: YES];
|
||||
return self;
|
||||
}
|
||||
|
||||
- (id) initWithStream: (NSInputStream*)stream
|
||||
{
|
||||
_handler = [NSXMLSAXHandler new];
|
||||
[myHandler _setOwner: self];
|
||||
_parser = [[GSXMLParser alloc] initWithSAXHandler: myHandler
|
||||
withInputStream: stream];
|
||||
[(GSXMLParser*)_parser substituteEntities: YES];
|
||||
return self;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue