Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions RVXMLDictionary.podspec
Original file line number Diff line number Diff line change
@@ -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
13 changes: 0 additions & 13 deletions XMLDictionary.podspec

This file was deleted.

13 changes: 10 additions & 3 deletions XMLDictionary/XMLDictionary.m
Original file line number Diff line number Diff line change
Expand Up @@ -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]])
{
Expand All @@ -146,7 +146,14 @@ + (NSString *)XMLStringForNode:(id)node withNodeName:(NSString *)nodeName
NSString *innerXML = [node innerXML];
if ([innerXML length])
{
return [NSString stringWithFormat:@"<%1$@%2$@>%3$@</%1$@>", nodeName, attributeString, innerXML];
if(nodeName)
{
return [NSString stringWithFormat:@"<%1$@%2$@>%3$@</%1$@>", nodeName, attributeString, innerXML];
}
else
{
return [NSString stringWithFormat:@"%@", innerXML];
}
}
else
{
Expand Down