mirror of
https://github.com/gnustep/libs-gui.git
synced 2025-05-31 16:40:50 +00:00
Parse XML into tree for processing.
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@37785 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
7c8eda0462
commit
22d1969783
2 changed files with 24 additions and 11 deletions
|
@ -1,3 +1,8 @@
|
|||
2014-04-03 00:55-EDT Gregory John Casamento <greg.casamento@gmail.com>
|
||||
|
||||
* Source/GSXibParser.m: Add code to parse XML into a tree
|
||||
so that it can be processed into instances.
|
||||
|
||||
2013-04-02 Frank Le Grand <frank.legrand@testplant.com>
|
||||
|
||||
* Source/NSToolbarItem.m: Fixed a bug where calling setImage:
|
||||
|
|
|
@ -84,7 +84,12 @@ didStartElement: (NSString*)elementName
|
|||
|
||||
// FIXME: We should use proper memory management here
|
||||
AUTORELEASE(element);
|
||||
|
||||
if ([@"document" isEqualToString: elementName])
|
||||
{
|
||||
currentElement = element;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (key != nil)
|
||||
{
|
||||
[currentElement setElement: element forKey: key];
|
||||
|
@ -94,18 +99,21 @@ didStartElement: (NSString*)elementName
|
|||
// For Arrays
|
||||
[currentElement addElement: element];
|
||||
}
|
||||
|
||||
// Maintain the stack...
|
||||
[stack addObject: currentElement];
|
||||
currentElement = element;
|
||||
}
|
||||
|
||||
[stack addObject: currentElement];
|
||||
}
|
||||
|
||||
- (void) parser: (NSXMLParser*)parser
|
||||
didEndElement: (NSString*)elementName
|
||||
namespaceURI: (NSString*)namespaceURI
|
||||
qualifiedName: (NSString*)qName
|
||||
{
|
||||
if (![@"document" isEqualToString: elementName])
|
||||
{
|
||||
currentElement = [stack lastObject];
|
||||
[stack removeLastObject];
|
||||
}
|
||||
}
|
||||
@end
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue