My favorites
▼
|
Sign in
touchcode
Repository of iPhone and iPod Touch source code.
Project Home
Export to GitHub
READ-ONLY: This project has been
archived
. For more information see
this post
.
Search
Search within:
All issues
Open issues
New issues
Issues to verify
for
Advanced search
Search tips
Subscriptions
Issue
51
attachment: TouchXML.patch
(1.8 KB)
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
44
45
46
47
48
49
50
51
52
diff --git a/Common/Source/CXMLElement.h b/Common/Source/CXMLElement.h
index 3cbdd65..5369fa5 100644
--- a/Common/Source/CXMLElement.h
+++ b/Common/Source/CXMLElement.h
@@ -46,5 +46,7 @@
//- (CXMLNode *)resolveNamespaceForName:(NSString *)name;
//- (NSString *)resolvePrefixForNamespaceURI:(NSString *)namespaceURI;
+- (NSString *)innerXMLString;
- (NSString*)_XMLStringWithOptions:(NSUInteger)options appendingToString:(NSMutableString*)str;
+- (NSString *)_innerXMLStringWithOptions:(NSUInteger)options appendingToString:(NSMutableString *)str;
@end
diff --git a/Common/Source/CXMLElement.m b/Common/Source/CXMLElement.m
index fe68c9b..cd69cec 100644
--- a/Common/Source/CXMLElement.m
+++ b/Common/Source/CXMLElement.m
@@ -92,6 +92,10 @@ return(NULL);
//- (CXMLNode *)resolveNamespaceForName:(NSString *)name;
//- (NSString *)resolvePrefixForNamespaceURI:(NSString *)namespaceURI;
+- (NSString *)innerXMLString {
+ return [self _innerXMLStringWithOptions:0 appendingToString:[NSMutableString string]];
+}
+
- (NSString*)_XMLStringWithOptions:(NSUInteger)options appendingToString:(NSMutableString*)str
{
NSString* name = [self name];
@@ -123,15 +127,19 @@ if ( ! _node->children )
[str appendString:@">"];
-if ( _node->children )
- {
- for (id child in [self children])
- [child _XMLStringWithOptions:options appendingToString:str];
- }
+[self _innerXMLStringWithOptions:options appendingToString:str];
[str appendString:[NSString stringWithFormat:@"</%@>", name]];
return str;
}
+- (NSString *)_innerXMLStringWithOptions:(NSUInteger)options appendingToString:(NSMutableString *)str {
+ if ( _node->children ) {
+ for (id child in [self children])
+ [child _XMLStringWithOptions:options appendingToString:str];
+ }
+ return str;
+}
+
- (NSString *)description
{
NSAssert(_node != NULL, @"TODO");
Powered by
Google Project Hosting