Skip to content

Commit 848cf10

Browse files
Revert dd_ prefix for additions
1 parent 806ee2a commit 848cf10

File tree

3 files changed

+21
-79
lines changed

3 files changed

+21
-79
lines changed

KissXML.podspec

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
Pod::Spec.new do |s|
22
s.name = 'KissXML'
3-
s.version = '5.3.0'
3+
s.version = '5.3.1'
44
s.license = { :type => 'MIT', :file => 'LICENSE.txt' }
55
s.summary = 'A replacement for Cocoa\'s NSXML cluster of classes. Based on libxml.'
66
s.homepage = 'https://github.com/robbiehanson/KissXML'

KissXML/Additions/DDXMLElementAdditions.h

+10-28
Original file line numberDiff line numberDiff line change
@@ -7,38 +7,20 @@
77
NS_ASSUME_NONNULL_BEGIN
88
@interface DDXMLElement (DDAdditions)
99

10-
+ (nullable DDXMLElement *)dd_elementWithName:(NSString *)name xmlns:(NSString *)ns;
10+
+ (nullable DDXMLElement *)elementWithName:(NSString *)name xmlns:(NSString *)ns;
1111

12-
- (nullable DDXMLElement *)dd_elementForName:(NSString *)name;
13-
- (nullable DDXMLElement *)dd_elementForName:(NSString *)name xmlns:(NSString *)xmlns;
12+
- (nullable DDXMLElement *)elementForName:(NSString *)name;
13+
- (nullable DDXMLElement *)elementForName:(NSString *)name xmlns:(NSString *)xmlns;
1414

15-
@property (nonatomic, readwrite, nullable) NSString *dd_xmlns;
15+
- (nullable NSString *)xmlns;
16+
- (void)setXmlns:(NSString *)ns;
1617

17-
@property (nonatomic, readonly) NSString *dd_prettyXMLString;
18-
@property (nonatomic, readonly) NSString *dd_compactXMLString;
18+
- (NSString *)prettyXMLString;
19+
- (NSString *)compactXMLString;
1920

20-
- (void)dd_addAttributeWithName:(NSString *)name stringValue:(NSString *)string;
21+
- (void)addAttributeWithName:(NSString *)name stringValue:(NSString *)string;
2122

22-
@property (nonatomic, readonly) NSDictionary<NSString*,NSString*> *dd_attributesAsDictionary;
23+
- (NSDictionary<NSString*,NSString*> *)attributesAsDictionary;
2324

2425
@end
25-
26-
@interface DDXMLElement (DDAdditionsDeprecated)
27-
28-
+ (nullable DDXMLElement *)elementWithName:(NSString *)name xmlns:(NSString *)ns DEPRECATED_MSG_ATTRIBUTE("use dd_elementWithName:xmlns: instead.");
29-
30-
- (nullable DDXMLElement *)elementForName:(NSString *)name DEPRECATED_MSG_ATTRIBUTE("use dd_elementForName: instead.");
31-
- (nullable DDXMLElement *)elementForName:(NSString *)name xmlns:(NSString *)xmlns DEPRECATED_MSG_ATTRIBUTE("use dd_elementForName:xmlns: instead.");
32-
33-
- (nullable NSString *)xmlns DEPRECATED_MSG_ATTRIBUTE("use dd_xmlns instead.");
34-
- (void)setXmlns:(NSString *)ns DEPRECATED_MSG_ATTRIBUTE("use setDd_xmlns: instead.");
35-
36-
- (NSString *)prettyXMLString DEPRECATED_MSG_ATTRIBUTE("use dd_prettyXMLString instead.");
37-
- (NSString *)compactXMLString DEPRECATED_MSG_ATTRIBUTE("use dd_compactXMLString instead.");
38-
39-
- (void)addAttributeWithName:(NSString *)name stringValue:(NSString *)string DEPRECATED_MSG_ATTRIBUTE("use dd_addAttributeWithName:stringValue: instead.");
40-
41-
- (NSDictionary<NSString*,NSString*> *)attributesAsDictionary DEPRECATED_MSG_ATTRIBUTE("use dd_attributesAsDictionary instead.");
42-
43-
@end
44-
NS_ASSUME_NONNULL_END
26+
NS_ASSUME_NONNULL_END

KissXML/Additions/DDXMLElementAdditions.m

+10-50
Original file line numberDiff line numberDiff line change
@@ -5,18 +5,18 @@ @implementation DDXMLElement (DDAdditions)
55
/**
66
* Quick method to create an element
77
**/
8-
+ (DDXMLElement *)dd_elementWithName:(NSString *)name xmlns:(NSString *)ns
8+
+ (DDXMLElement *)elementWithName:(NSString *)name xmlns:(NSString *)ns
99
{
1010
DDXMLElement *element = [DDXMLElement elementWithName:name];
11-
element.dd_xmlns = ns;
11+
[element setXmlns:ns];
1212
return element;
1313
}
1414

1515
/**
1616
* This method returns the first child element for the given name.
1717
* If no child element exists for the given name, returns nil.
1818
**/
19-
- (DDXMLElement *)dd_elementForName:(NSString *)name
19+
- (DDXMLElement *)elementForName:(NSString *)name
2020
{
2121
NSArray *elements = [self elementsForName:name];
2222
if([elements count] > 0)
@@ -54,7 +54,7 @@ - (DDXMLElement *)dd_elementForName:(NSString *)name
5454
* This method returns the first child element for the given name and given xmlns.
5555
* If no child elements exist for the given name and given xmlns, returns nil.
5656
**/
57-
- (DDXMLElement *)dd_elementForName:(NSString *)name xmlns:(NSString *)xmlns
57+
- (DDXMLElement *)elementForName:(NSString *)name xmlns:(NSString *)xmlns
5858
{
5959
NSArray *elements = [self elementsForLocalName:name URI:xmlns];
6060
if([elements count] > 0)
@@ -71,12 +71,12 @@ - (DDXMLElement *)dd_elementForName:(NSString *)name xmlns:(NSString *)xmlns
7171
* Returns the common xmlns "attribute", which is only accessible via the namespace methods.
7272
* The xmlns value is often used in jabber elements.
7373
**/
74-
- (NSString *)dd_xmlns
74+
- (NSString *)xmlns
7575
{
7676
return [[self namespaceForPrefix:@""] stringValue];
7777
}
7878

79-
- (void)setDd_xmlns:(NSString *)ns
79+
- (void)setXmlns:(NSString *)ns
8080
{
8181
// If you use setURI: then the xmlns won't be displayed in the XMLString.
8282
// Adding the namespace this way works properly.
@@ -89,31 +89,31 @@ - (void)setDd_xmlns:(NSString *)ns
8989
/**
9090
* Shortcut to get a pretty (formatted) string representation of the element.
9191
**/
92-
- (NSString *)dd_prettyXMLString
92+
- (NSString *)prettyXMLString
9393
{
9494
return [self XMLStringWithOptions:(DDXMLNodePrettyPrint | DDXMLNodeCompactEmptyElement)];
9595
}
9696

9797
/**
9898
* Shortcut to get a compact string representation of the element.
9999
**/
100-
- (NSString *)dd_compactXMLString
100+
- (NSString *)compactXMLString
101101
{
102102
return [self XMLStringWithOptions:DDXMLNodeCompactEmptyElement];
103103
}
104104

105105
/**
106106
* Shortcut to avoid having to manually create a DDXMLNode everytime.
107107
**/
108-
- (void)dd_addAttributeWithName:(NSString *)name stringValue:(NSString *)string
108+
- (void)addAttributeWithName:(NSString *)name stringValue:(NSString *)string
109109
{
110110
[self addAttribute:[DDXMLNode attributeWithName:name stringValue:string]];
111111
}
112112

113113
/**
114114
* Returns all the attributes as a dictionary.
115115
**/
116-
- (NSDictionary *)dd_attributesAsDictionary
116+
- (NSDictionary *)attributesAsDictionary
117117
{
118118
NSArray *attributes = [self attributes];
119119
NSMutableDictionary *result = [NSMutableDictionary dictionaryWithCapacity:[attributes count]];
@@ -129,43 +129,3 @@ - (NSDictionary *)dd_attributesAsDictionary
129129
}
130130

131131
@end
132-
133-
@implementation DDXMLElement (DDAdditionsDeprecated)
134-
135-
+ (nullable DDXMLElement *)elementWithName:(NSString *)name xmlns:(NSString *)ns {
136-
return [self dd_elementWithName:name xmlns:ns];
137-
}
138-
139-
- (nullable DDXMLElement *)elementForName:(NSString *)name {
140-
return [self dd_elementForName:name];
141-
}
142-
143-
- (nullable DDXMLElement *)elementForName:(NSString *)name xmlns:(NSString *)xmlns {
144-
return [self dd_elementForName:name xmlns:xmlns];
145-
}
146-
147-
- (nullable NSString *)xmlns {
148-
return [self dd_xmlns];
149-
}
150-
151-
- (void)setXmlns:(NSString *)ns {
152-
[self setDd_xmlns:ns];
153-
}
154-
155-
- (NSString *)prettyXMLString {
156-
return [self dd_prettyXMLString];
157-
}
158-
159-
- (NSString *)compactXMLString {
160-
return [self dd_compactXMLString];
161-
}
162-
163-
- (void)addAttributeWithName:(NSString *)name stringValue:(NSString *)string {
164-
return [self dd_addAttributeWithName:name stringValue:string];
165-
}
166-
167-
- (NSDictionary<NSString*,NSString*> *)attributesAsDictionary {
168-
return [self dd_attributesAsDictionary];
169-
}
170-
171-
@end

0 commit comments

Comments
 (0)