File tree Expand file tree Collapse file tree 1 file changed +7
-5
lines changed Expand file tree Collapse file tree 1 file changed +7
-5
lines changed Original file line number Diff line number Diff line change 11HTML SAX Parser for Swift 3
22======
3- ** HTMLSAXParser** is a swift module that wraps the libxml2 HTMLParse for the purposes
4- of providing a simple lightweight SAX parser for HTML content. SAX parsers provide
5- an event based parsing process, where a closure you provide will be called with
6- a series of events as the parser moves through the document.
3+ ** HTMLSAXParser** is a swift module that wraps the libxml2 HTMLParser for the purposes
4+ of providing a simple lightweight SAX parser for HTML content. libxml2 is part of the
5+ Mac, iOS and Apple TV SDK, if you are developing for those platforms then you will not
6+ require any additional dependencies. SAX parsers provide an event based parsing process,
7+ where a closure you provide will be called with a series of events as the parser moves
8+ through the document.
79
810** HTMLSAXParser** uses enums with associated types for the parsing events and a
911simple of example of usage is: -
1012
1113```
1214let parser = HTMLSAXParser()
1315do {
14- try parser.parse(string: "<html><body>Some HTML Content</body></html>) { event in
16+ try parser.parse(string: "<html><body>Some HTML Content</body></html>" ) { event in
1517 switch event {
1618 case let .startElement(name, attributes, location):
1719 print("Found character : \(name)")
You can’t perform that action at this time.
0 commit comments