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>
|
2013-04-02 Frank Le Grand <frank.legrand@testplant.com>
|
||||||
|
|
||||||
* Source/NSToolbarItem.m: Fixed a bug where calling setImage:
|
* Source/NSToolbarItem.m: Fixed a bug where calling setImage:
|
||||||
|
|
|
@ -84,20 +84,25 @@ didStartElement: (NSString*)elementName
|
||||||
|
|
||||||
// FIXME: We should use proper memory management here
|
// FIXME: We should use proper memory management here
|
||||||
AUTORELEASE(element);
|
AUTORELEASE(element);
|
||||||
|
if ([@"document" isEqualToString: elementName])
|
||||||
if (key != nil)
|
|
||||||
{
|
{
|
||||||
[currentElement setElement: element forKey: key];
|
currentElement = element;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
// For Arrays
|
if (key != nil)
|
||||||
[currentElement addElement: element];
|
{
|
||||||
|
[currentElement setElement: element forKey: key];
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
// For Arrays
|
||||||
|
[currentElement addElement: element];
|
||||||
|
}
|
||||||
|
currentElement = element;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Maintain the stack...
|
[stack addObject: currentElement];
|
||||||
[stack addObject: currentElement];
|
|
||||||
currentElement = element;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
- (void) parser: (NSXMLParser*)parser
|
- (void) parser: (NSXMLParser*)parser
|
||||||
|
@ -105,7 +110,10 @@ didStartElement: (NSString*)elementName
|
||||||
namespaceURI: (NSString*)namespaceURI
|
namespaceURI: (NSString*)namespaceURI
|
||||||
qualifiedName: (NSString*)qName
|
qualifiedName: (NSString*)qName
|
||||||
{
|
{
|
||||||
currentElement = [stack lastObject];
|
if (![@"document" isEqualToString: elementName])
|
||||||
[stack removeLastObject];
|
{
|
||||||
|
currentElement = [stack lastObject];
|
||||||
|
[stack removeLastObject];
|
||||||
|
}
|
||||||
}
|
}
|
||||||
@end
|
@end
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue