DDXMLElement.h
2.48 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
53
54
55
56
57
58
59
60
61
62
63
64
65
66
#import <Foundation/Foundation.h>
#import "DDXMLNode.h"
/**
* Welcome to KissXML.
*
* The project page has documentation if you have questions.
* https://github.com/robbiehanson/KissXML
*
* If you're new to the project you may wish to read the "Getting Started" wiki.
* https://github.com/robbiehanson/KissXML/wiki/GettingStarted
*
* KissXML provides a drop-in replacement for Apple's NSXML class cluster.
* The goal is to get the exact same behavior as the NSXML classes.
*
* For API Reference, see Apple's excellent documentation,
* either via Xcode's Mac OS X documentation, or via the web:
*
* https://github.com/robbiehanson/KissXML/wiki/Reference
**/
NS_ASSUME_NONNULL_BEGIN
@interface DDXMLElement : DDXMLNode
{
}
- (instancetype)initWithName:(NSString *)name;
- (instancetype)initWithName:(NSString *)name URI:(nullable NSString *)URI;
- (instancetype)initWithName:(NSString *)name stringValue:(nullable NSString *)string;
- (nullable instancetype)initWithXMLString:(NSString *)string error:(NSError **)error;
#pragma mark --- Elements by name ---
- (NSArray<DDXMLElement *> *)elementsForName:(NSString *)name;
- (NSArray<DDXMLElement *> *)elementsForLocalName:(NSString *)localName URI:(nullable NSString *)URI;
#pragma mark --- Attributes ---
- (void)addAttribute:(DDXMLNode *)attribute;
- (void)removeAttributeForName:(NSString *)name;
@property (nullable, copy) NSArray<DDXMLNode *> *attributes;
//- (void)setAttributesAsDictionary:(NSDictionary *)attributes;
- (nullable DDXMLNode *)attributeForName:(NSString *)name;
//- (DDXMLNode *)attributeForLocalName:(NSString *)localName URI:(NSString *)URI;
#pragma mark --- Namespaces ---
- (void)addNamespace:(DDXMLNode *)aNamespace;
- (void)removeNamespaceForPrefix:(NSString *)name;
@property (nullable, copy) NSArray<DDXMLNode *> *namespaces; //primitive
- (nullable DDXMLNode *)namespaceForPrefix:(NSString *)prefix;
- (nullable DDXMLNode *)resolveNamespaceForName:(NSString *)name;
- (nullable NSString *)resolvePrefixForNamespaceURI:(NSString *)namespaceURI;
#pragma mark --- Children ---
- (void)insertChild:(DDXMLNode *)child atIndex:(NSUInteger)index;
//- (void)insertChildren:(NSArray *)children atIndex:(NSUInteger)index;
- (void)removeChildAtIndex:(NSUInteger)index;
- (void)setChildren:(nullable NSArray<DDXMLNode *> *)children;
- (void)addChild:(DDXMLNode *)child;
//- (void)replaceChildAtIndex:(NSUInteger)index withNode:(DDXMLNode *)node;
//- (void)normalizeAdjacentTextNodesPreservingCDATA:(BOOL)preserve;
@end
NS_ASSUME_NONNULL_END