forked from tomaz/appledoc
/
XMLBasedOutputGenerator+HierarchyParsingAPI.m
43 lines (36 loc) · 1.42 KB
/
XMLBasedOutputGenerator+HierarchyParsingAPI.m
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
//
// XMLBasedOutputGenerator+HierarchyParsingAPI.m
// appledoc
//
// Created by Tomaz Kragelj on 28.5.09.
// Copyright (C) 2009, Tomaz Kragelj. All rights reserved.
//
#import "XMLBasedOutputGenerator+GeneralParsingAPI.h"
#import "XMLBasedOutputGenerator+HierarchyParsingAPI.h"
#import "DoxygenConverter.h"
@implementation XMLBasedOutputGenerator (HierarchyParsingAPI)
//////////////////////////////////////////////////////////////////////////////////////////
#pragma mark Hierarchy items parsing support
//////////////////////////////////////////////////////////////////////////////////////////
//----------------------------------------------------------------------------------------
- (NSString*) extractHierarchyGroupItemRef:(id) item
{
NSXMLNode* idAttr = [item attributeForName:@"id"];
if (idAttr) return [idAttr stringValue];
return nil;
}
//----------------------------------------------------------------------------------------
- (NSString*) extractHierarchyGroupItemName:(id) item
{
NSXMLElement* nameNode = [self extractSubitemFromItem:item withName:@"name"];
if (nameNode) return [nameNode stringValue];
return @"";
}
//----------------------------------------------------------------------------------------
- (NSArray*) extractHierarchyGroupItemChildren:(id) item
{
NSArray* childrenNodes = [item nodesForXPath:@"children/object" error:nil];
if ([childrenNodes count] > 0) return childrenNodes;
return nil;
}
@end