Skip to content

Commit 5859164

Browse files
committed
Updated README.
1 parent 269f55b commit 5859164

File tree

1 file changed

+19
-19
lines changed

1 file changed

+19
-19
lines changed

README.md

Lines changed: 19 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -5,28 +5,28 @@ SMXMLDocument is a very handy lightweight XML parser for iOS.
55

66
In brief:
77

8-
// create a new SMXMLDocument with the contents of sample.xml
9-
SMXMLDocument *document = [SMXMLDocument documentWithData:data error:&error];
10-
11-
// Pull out the <books> node
12-
SMXMLElement *books = [document.root childNamed:@"books"];
13-
14-
// Look through <books> children of type <book>
15-
for (SMXMLElement *book in [books childrenNamed:@"book"]) {
16-
17-
// demonstrate common cases of extracting XML data
18-
NSString *isbn = [book attributeNamed:@"isbn"]; // XML attribute
19-
NSString *title = [book valueWithPath:@"title"]; // child node value
20-
21-
// show off some KVC magic
22-
NSArray *authors = [[book childNamed:@"authors"].children valueForKey:@"value"];
23-
24-
// do interesting things...
25-
}
8+
// create a new SMXMLDocument with the contents of sample.xml
9+
SMXMLDocument *document = [SMXMLDocument documentWithData:data error:&error];
10+
11+
// Pull out the <books> node
12+
SMXMLElement *books = [document.root childNamed:@"books"];
13+
14+
// Look through <books> children of type <book>
15+
for (SMXMLElement *book in [books childrenNamed:@"book"]) {
16+
17+
// demonstrate common cases of extracting XML data
18+
NSString *isbn = [book attributeNamed:@"isbn"]; // XML attribute
19+
NSString *title = [book valueWithPath:@"title"]; // child node value
20+
21+
// show off some KVC magic
22+
NSArray *authors = [[book childNamed:@"authors"].children valueForKey:@"value"];
23+
24+
// do interesting things...
25+
}
2626

2727
More info in the blog post:
2828
http://nfarina.com/post/2843708636/a-lightweight-xml-parser-for-ios
2929

3030
### ARC Support
3131

32-
This branch supports (and requires) [Automatic Reference Counting (ARC)](http://clang.llvm.org/docs/AutomaticReferenceCounting.html)
32+
This branch supports (and requires) [Automatic Reference Counting (ARC)](http://clang.llvm.org/docs/AutomaticReferenceCounting.html)

0 commit comments

Comments
 (0)