diff --git a/RVXMLDictionary.podspec b/RVXMLDictionary.podspec new file mode 100644 index 0000000..f7b361e --- /dev/null +++ b/RVXMLDictionary.podspec @@ -0,0 +1,13 @@ +Pod::Spec.new do |s| + s.name = "RVXMLDictionary" + s.version = "1.5" + s.license = { :type => 'zlib', :file => 'LICENCE.md' } + s.summary = "RVXMLDictionary is a class designed to simplify parsing and generating of XML on iOS and Mac OS." + s.homepage = "https://github.com/BadChoice/XMLDictionary" + s.authors = "BadChoice" + s.source = { :git => "https://github.com/BadChoice/XMLDictionary.git", :tag => "1.5" } + s.source_files = 'XMLDictionary' + s.requires_arc = true + s.ios.deployment_target = '8.0' + s.osx.deployment_target = '10.6' +end diff --git a/XMLDictionary.podspec b/XMLDictionary.podspec deleted file mode 100644 index c2260e5..0000000 --- a/XMLDictionary.podspec +++ /dev/null @@ -1,13 +0,0 @@ -Pod::Spec.new do |s| - s.name = "XMLDictionary" - s.version = "1.4" - s.license = { :type => 'zlib', :file => 'LICENCE.md' } - s.summary = "XMLDictionary is a class designed to simplify parsing and generating of XML on iOS and Mac OS." - s.homepage = "https://github.com/nicklockwood/XMLDictionary" - s.authors = "Nick Lockwood" - s.source = { :git => "https://github.com/nicklockwood/XMLDictionary.git", :tag => "1.4" } - s.source_files = 'XMLDictionary' - s.requires_arc = true - s.ios.deployment_target = '4.3' - s.osx.deployment_target = '10.6' -end diff --git a/XMLDictionary/XMLDictionary.m b/XMLDictionary/XMLDictionary.m index a7f7ab0..58d38d4 100644 --- a/XMLDictionary/XMLDictionary.m +++ b/XMLDictionary/XMLDictionary.m @@ -130,9 +130,9 @@ + (NSString *)XMLStringForNode:(id)node withNodeName:(NSString *)nodeName NSMutableArray *nodes = [NSMutableArray arrayWithCapacity:[node count]]; for (id individualNode in node) { - [nodes addObject:[self XMLStringForNode:individualNode withNodeName:nodeName]]; + [nodes addObject:[self XMLStringForNode:individualNode withNodeName:nil]]; } - return [nodes componentsJoinedByString:@"\n"]; + return [NSString stringWithFormat:@"<%@>%@",nodeName,[nodes componentsJoinedByString:@"\n"],nodeName]; } else if ([node isKindOfClass:[NSDictionary class]]) { @@ -146,7 +146,14 @@ + (NSString *)XMLStringForNode:(id)node withNodeName:(NSString *)nodeName NSString *innerXML = [node innerXML]; if ([innerXML length]) { - return [NSString stringWithFormat:@"<%1$@%2$@>%3$@", nodeName, attributeString, innerXML]; + if(nodeName) + { + return [NSString stringWithFormat:@"<%1$@%2$@>%3$@", nodeName, attributeString, innerXML]; + } + else + { + return [NSString stringWithFormat:@"%@", innerXML]; + } } else {