Slide 1

Slide 1 text

೔޲ڧ5TVZPTIJ)ZVHB ྩ࿨࣌୅ͷ9.-ॲཧΛ ߟ͑Δ ʙ΋͋͠ͳ͕ͨڊେͳ9.-ͱ૬ݟ͑Δ͜ͱʹͳͬͨ Βʙ

Slide 2

Slide 2 text

ηογϣϯΛݟΒΕ͍ͯΔօ͞Μ ͸͡Ίʹ

Slide 3

Slide 3 text

w ͳͥࠓ9.-ʁ ηογϣϯΛݟΒΕ͍ͯΔօ͞Μ ͸͡Ίʹ

Slide 4

Slide 4 text

9.-͸͋ͳͨͷۙ͘ʹ ͍ΔΑ

Slide 5

Slide 5 text

9*# 9.-*OUFSGBDF#VJMEFS

Slide 6

Slide 6 text

9*# 9.-*OUFSGBDF#VJMEFS •

Slide 7

Slide 7 text

)FBMUI,JU ݈߁σʔλ

Slide 8

Slide 8 text

)FBMUI,JU ݈߁σʔλ w ϔϧεέΞ w ϒϥ΢ζ w ͢΂ͯͷϔϧεέΞσ ʔλΛॻ͖ग़͢ w 9.-Ͱॻ͖ग़͞Ε Δ

Slide 9

Slide 9 text

&16# ిࢠॻ੶ϑΝΠϧϑΥʔϚοτ w ϚϯΨͳͲɺిࢠॻ੶ʹ࢖ ΘΕΔϑΥʔϚοτ

Slide 10

Slide 10 text

ອը͸͋ͳͨͷۙ͘ʹ͍ ΔΑ

Slide 11

Slide 11 text

J04ʹΑΔ9.-ͷॲཧ

Slide 12

Slide 12 text

ͷલʹ

Slide 13

Slide 13 text

J04ʹΑΔ+40/ͷॲཧ

Slide 14

Slide 14 text

J04ʹΑΔ9.-ͷॲཧ J04ʹΑΔ+40/ͷॲཧͷ৔߹ $PEBCMF +40/σʔλͷ৔߹ɺ$PEBCMFΛ࢖͏͜ͱͰ+40/ΛΦϒδΣΫτԽ

Slide 15

Slide 15 text

J04ʹΑΔ9.-ͷॲཧ J04ʹΑΔ+40/ͷॲཧͷ৔߹ 9.-ͷ৔߹͸ʁ

Slide 16

Slide 16 text

%0.

Slide 17

Slide 17 text

w 9.-σʔλΛಡΈࠐΈɺΞΫηεՄೳʹͨ͠Ϟσϧ w 9.-Λ%0.ԽͰ͖Δ"1*͕͋Ε͹ɺJ04Ͱ΋ΦϒδΣΫτͱ͠ ͯѻ͑ͦ͏ %PDVNFOU0CKFDU.PEFM %0.

Slide 18

Slide 18 text

9.-"1*

Slide 19

Slide 19 text

w 9.-%PDVNFOU w 9.-1BSTFS w MJCYNM ఏڙ͞Ε͍ͯΔ"1* 9.-"1*

Slide 20

Slide 20 text

w 9.-%PDVNFOUˡ%0.ʹରԠ w 9.-1BSTFS w MJCYNM ఏڙ͞Ε͍ͯΔ"1* 9.-"1*

Slide 21

Slide 21 text

·ͱΊ

Slide 22

Slide 22 text

w 9.-Λ%0.ͱͯ͠ѻ͏ͱ͖͸9.-%PDVNFOUΛ࢖͓͏ʂ ྩ࿨࣌୅ͷ9.-ॲཧΛߟ͑Δ ·ͱΊ

Slide 23

Slide 23 text

࣮ࡍʹ࢖ͬͯΈΔ

Slide 24

Slide 24 text

࣮ࡍʹ࢖ͬͯΈΔ 9.-%PDVNFOU w 9.-%PDVNFOUΛ࢖ͬͯ ͷ9.-಺༰දࣔ let data = NSDataAsset(name: "Rss")!.data let doc = try! XMLDocument(data: data) text = doc.rootElement()? .elements(forName: "channel").first? .elements(forName: "title").first? .stringValue ?? "" print(text) // RSSͷλΠτϧදࣔ

Slide 25

Slide 25 text

࣮ࡍʹ࢖ͬͯΈΔ 9.-%PDVNFOU w 9.-%PDVNFOUΛ࢖ͬͯ ͷ9.-಺༰දࣔ w 9.-%PDVNFOU͕J04 Ͱ͸ϏϧυΤϥʔ let data = NSDataAsset(name: "Rss")!.data // Cannot find 'XMLDocument' in scope let doc = try! XMLDocument(data: data) text = doc.rootElement()? .elements(forName: "channel").first? .elements(forName: "title").first? .stringValue ?? "" print(text) // RSSͷλΠτϧදࣔ

Slide 26

Slide 26 text

IUUQTEFWFMPQFSBQQMFDPN EPDVNFOUBUJPOGPVOEBUJPO YNMEPDVNFOU

Slide 27

Slide 27 text

࣮ࡍʹ࢖ͬͯΈΔ 9.-%PDVNFOU w 9.-%PDVNFOUΛ࢖ͬͯ ͷ9.-಺༰දࣔ w 9.-%PDVNFOU͕J04 Ͱ͸ϏϧυΤϥʔ w 9.-%PDVNFOU͸ NBD04ͷΈͷରԠ let data = NSDataAsset(name: "Rss")!.data #if os(macOS) let doc = try! XMLDocument(data: data) text = doc.rootElement()? .elements(forName: "channel").first? .elements(forName: "title").first? .stringValue ?? "" #endif print(text) // RSSͷλΠτϧදࣔ

Slide 28

Slide 28 text

w 9.-Λѻ͏ͱ͖͸9.-%PDVNFOUΛ࢖͓͏ʂ w J04Ͱ͸࢖͑ͳ͍ʂ ྩ࿨࣌୅ͷ9.-ॲཧΛߟ͑Δ ·ͱΊ

Slide 29

Slide 29 text

ผͳํ๏Ͱ%0.Λ࡞Δ

Slide 30

Slide 30 text

w 9.-%PDVNFOU w 9.-1BSTFS w MJCYNM ఏڙ͞Ε͍ͯΔ"1* 9.-"1*

Slide 31

Slide 31 text

w 9.-%PDVNFOU w 9.-1BSTFS w MJCYNMˡ͜ΕΛ࢖ͬͯ%0.Λ࡞Εͦ͏ w MJCYNM͸$ͷϥΠϒϥϦ ఏڙ͞Ε͍ͯΔ"1* 9.-"1*

Slide 32

Slide 32 text

0CKFDUJWF$

Slide 33

Slide 33 text

MJCYNM 0CKFDUJWF$ NSURL* url; auto fileUrl = [[url absoluteString] UTF8String]; auto document = xmlReadFile(fileUrl, NULL, XML_PARSE_HUGE); auto cur = xmlDocGetRootElement(document); if (xmlStrcmp(cur->name, (xmlChar *)"HealthData") != 0) { return @""; } cur = cur->children; while (cur != NULL) { if ((!xmlStrcmp(cur->name, (const xmlChar*)”ExportDate"))) { auto value = xmlGetProp(cur, (xmlChar *)"value"); auto valueString = [NSString stringWithCString:(char*)value encoding:NSUTF8StringEncoding]; return valueString; // xmlͷग़ྗ೔෇औಘ } cur = cur->next; } return @"";

Slide 34

Slide 34 text

ϔϧεέΞσʔλΛ ಡΈࠐΜͰΈΑ͏

Slide 35

Slide 35 text

MJCYNMʹΑΔಡΈࠐΈ ϔϧεέΞσʔλͷಡΈࠐΈ w ϔϧεέΞσʔλͷYNMϑ ΝΠϧΛಡΈࠐΈ

Slide 36

Slide 36 text

MJCYNMʹΑΔಡΈࠐΈ ϔϧεέΞσʔλͷಡΈࠐΈ w ϔϧεέΞσʔλͷYNMϑ ΝΠϧΛಡΈࠐΈ w (͋Γ·͢

Slide 37

Slide 37 text

MJCYNMʹΑΔಡΈࠐΈ ϔϧεέΞσʔλͷಡΈࠐΈ w ϔϧεέΞσʔλͷYNMϑ ΝΠϧΛಡΈࠐΈ w (͋Γ·͢ let url = Bundle.main.url(forResource: "export", withExtension: "xml")! let start = Date() // ಺෦ͰlibxmlΛ࢖ͬͯಡΈࠐΈ let obj = MyObject(url: url) text = obj.readText() let end = Date() print(start.distance(to: end)) print(text)

Slide 38

Slide 38 text

MJCYNMʹΑΔಡΈࠐΈ ϔϧεέΞσʔλͷಡΈࠐΈ w ϔϧεέΞσʔλͷYNMϑ ΝΠϧΛಡΈࠐΈ w (͋Γ·͢ w ಡΈࠐΈ͢Δͷʹ ඵ͔͔Δ let url = Bundle.main.url(forResource: "export", withExtension: "xml")! let start = Date() // ಺෦ͰlibxmlΛ࢖ͬͯಡΈࠐΈ let obj = MyObject(url: url) text = obj.readText() let end = Date() print(start.distance(to: end)) //←35ඵ print(text)

Slide 39

Slide 39 text

No content

Slide 40

Slide 40 text

w 4"9 &WFOU%SJWFO9.- w %0. 5SFF#BTFE9.- 9.-ॲཧͷछྨ Ұൠతͳ9.-ͷղੳ

Slide 41

Slide 41 text

w 4"9 &WFOU%SJWFO9.- w 9.-Λઌ಄͔ΒಡΈࠐΈɺಛ௃఺͕ݟ͔ͭΔͨͼʹΠϕϯτͱͯ͠ฦ͢ w 9.-1BSTFS w %0. 5SFF#BTFE9.- w 9.-ΛશͯಡΈࠐΜͰΦϒδΣΫτԽ͠ɺΦϒδΣΫτ͔Βඞཁͳσʔ λʹΞΫηε͢Δ w େྔͷϦιʔε͕ඞཁʹͳΔ w 9.-%PDVNFOU .BDͷΈ 9.-ॲཧͷछྨ Ұൠతͳ9.-ͷղੳ

Slide 42

Slide 42 text

J04Ͱͷશͯͷσʔλͷ ಡΈࠐΈ͸ݱ࣮తͰ͸ͳ͍

Slide 43

Slide 43 text

w 9.-%PDVNFOU w 9.-1BSTFSˡJ04͸͜Ε w MJCYNM ఏڙ͞Ε͍ͯΔ"1* 9.-"1*

Slide 44

Slide 44 text

9.-1BSTFSΛ࢖༻͢Δ

Slide 45

Slide 45 text

9.-1BSTFSʹΑΔಡΈࠐΈ ϔϧεέΞσʔλͷಡΈࠐΈ w ϔϧεέΞσʔλͷYNMϑ ΝΠϧΛಡΈࠐΈ w (ͷYNMϑΝΠϧ let url = Bundle.main.url(forResource: "export", withExtension: "xml")! let start = Date() let parser = XMLParser(contentsOf: url)! // ඞཁͳ஋Λऔಘ͢ΔͨΊͷॲཧΛdelegateʹ࣮૷ parser.delegate = self parser.parse() let end = Date() print(text) print(start.distance(to: end))

Slide 46

Slide 46 text

9.-1BSTFSʹΑΔಡΈࠐΈ ϔϧεέΞσʔλͷಡΈࠐΈ w ϔϧεέΞσʔλͷYNMϑ ΝΠϧΛಡΈࠐΈ w (ͷYNMϑΝΠϧ w ඵͰඞཁͳςΩε τ͕औಘͰ͖Δ w ΠϕϯτΛ؂ࢹ͠ɺඞ ཁͳσʔλΛऔಘ͠ऴ ͑ͨΒૣظऴྃ͢Δ let url = Bundle.main.url(forResource: "export", withExtension: "xml")! let start = Date() let parser = XMLParser(contentsOf: url)! // ඞཁͳ஋Λऔಘ͢ΔͨΊͷॲཧΛdelegateʹ࣮૷ parser.delegate = self parser.parse() let end = Date() print(text) print(start.distance(to: end)) // ← 0.2ඵ

Slide 47

Slide 47 text

9.-1BSTFSʹΑΔಡΈࠐΈ ϔϧεέΞσʔλͷಡΈࠐΈ w ϔϧεέΞσʔλͷYNMϑ ΝΠϧΛಡΈࠐΈ w (ͷYNMϑΝΠϧ w ඵͰඞཁͳςΩε τ͕औಘͰ͖Δ w ΠϕϯτΛ؂ࢹ͠ɺඞ ཁͳσʔλΛऔಘ͠ऴ ͑ͨΒૣظऴྃ͢Δ // MARK: - XMLParserDelegate func parser(_ parser: XMLParser, didStartElement elementName: String, namespaceURI: String?, qualifiedName qName: String?, attributes attributeDict: [String : String] = [:]) { // σʔλऔಘʹඞཁͳॲཧΛߦ͏ } func parser(_ parser: XMLParser, didEndElement elementName: String, namespaceURI: String?, qualifiedName qName: String?) { // ඞཁͳσʔλ͕औಘͰ͖ͨΒɺXMLParserΛૣظऴྃ parser.abortParsing() }

Slide 48

Slide 48 text

9.-1BSTFSͷ࢖͍ํ

Slide 49

Slide 49 text

9.-1BSTFS खॱ w 9.-1BSTFSͷॳظԽ w %BUB w *OQVU4USFBN w 63- w 9.-1BSTFS%FMFHBUFΛઃఆͯ͠ ΠϕϯτΛड͚औΕΔΑ͏ʹ͢Δ w 9.-1BSTFSQBSTF Λ࣮ߦͯ͠ ֤छΠϕϯτΛEFMFHBUFͰॲཧ

Slide 50

Slide 50 text

9.-1BSTFS खॱ w 9.-1BSTFSͷॳظԽ w %BUB w *OQVU4USFBN w 63- w 9.-1BSTFS%FMFHBUFΛઃఆͯ͠ ΠϕϯτΛड͚औΕΔΑ͏ʹ͢Δ w 9.-1BSTFSQBSTF Λ࣮ߦͯ͠ ֤छΠϕϯτΛEFMFHBUFͰॲཧ let parser = XMLParser(contentsOf: url)! // ॳظԽ parser.delegate = self //delegateઃఆ parser.parse() // ॲཧ։࢝

Slide 51

Slide 51 text

Α͘࢖͏GVOD 9.-1BSTFS%FMFHBUF

Slide 52

Slide 52 text

w 9.-1BSTFS%FMFHBUFQBSTFS @EJE4UBSU&MFNFOUOBNFTQBDF63*RV BMJ fi FE/BNFBUUSJCVUFT w ཁૉ໊ͷ։͕࢝ݟ͔ͭͬͨ৔߹ʹݺͼग़͞ΕΔ w 9.-1BSTFS%FMFHBUFQBSTFS @GPVOE$IBSBDUFST w ಺༰͕ݟ͔ͭͬͨ৔߹ʹݺͼग़͞ΕΔ w ҰճͰ͸಺༰͕શͯಡΈऔΕͣɺෳ਺ճݺ͹ΕΔ৔߹΋͋Δ w 9.-1BSTFS%FMFHBUFQBSTFS @EJE&OE&MFNFOUOBNFTQBDF63*RVBM J fi FE/BNF w ཁૉ໊ͷऴ͕ྃݟ͔ͭͬͨ৔߹ʹݺͼग़͞ΕΔ Α͘࢖͏GVOD 9.-1BSTFS%FMFHBUF

Slide 53

Slide 53 text

<ಛٕ>ԕ͘ͰςϨϏͷిݯ͕ೖͬͨ͜ͱ͕Θ͔Δಛٕ>

Slide 54

Slide 54 text

EJE4UBSU&MFNFOU GPVOE$IBSBDUFST EJE&OE&MFNFOU <ಛٕ>ԕ͘ͰςϨϏͷిݯ͕ೖͬͨ͜ͱ͕Θ͔Δಛٕ>

Slide 55

Slide 55 text

಺༰ͷऔಘ func parser(_ parser: XMLParser, foundCharacters string: String) { print(string) // ԕ͘ͰςϨϏͷిݯ͕ೖͬͨ͜ͱ͕Θ͔Δ } 9.-1BSTFS%FMFHBUF

Slide 56

Slide 56 text

ෳ਺ߦͷ9.-

Slide 57

Slide 57 text

<ϓϩϑΟʔϧ> <໊લ>೔޲ڧ໊લ> <ॴଐ>גࣜձࣾAmaziaॴଐ> <աڈͷiOSDC> <λΠτϧ year="2019">BLEͰiOS/AndroidؒͰͦͦ͜͜େ͖ͳαΠζͷσʔλ௨৴Λ࣮ݱ͢Δ (L2CAP΋͋ΔΑ)λΠτϧ> <λΠτϧ year="2020">ৄղStoryboardλΠτϧ> <λΠτϧ year="2020">͋ͳͨͷ஌Βͳ͍࿈བྷઌͷੈքλΠτϧ> <λΠτϧ year="2021">όοΫάϥ΢ϯυͰΞϓϦ͕Ωϧ͞Εͯ΋ා͘ͳ͍ʂΞϓϦͷঢ়ଶΛݩʹ໭͢ϦετΞػೳͷશͯλΠτϧ> աڈͷiOSDC> <޷͖ͳ3DO>REAL޷͖ͳ3DO> <ಛٕ>ԕ͘ͰςϨϏͷిݯ͕ೖͬͨ͜ͱ͕Θ͔Δಛٕ> ϓϩϑΟʔϧ>

Slide 58

Slide 58 text

಺༰ͷऔಘ func parser(_ parser: XMLParser, foundCharacters string: String) { print(string) // ೔޲ڧ // גࣜձࣾAmazia // BLEͰiOS/AndroidؒͰͦͦ͜͜େ͖ͳαΠζͷσʔλ௨৴Λ࣮ݱ͢Δ (L2CAP΋͋ΔΑ) // ৄղStoryboard // ͋ͳͨͷ஌Βͳ͍࿈བྷઌͷੈք // όοΫάϥ΢ϯυͰΞϓϦ͕Ωϧ͞Εͯ΋ා͘ͳ͍ʂΞϓϦͷঢ়ଶΛݩʹ໭͢ϦετΞػೳͷશͯ // REAL // ԕ͘ͰςϨϏͷిݯ͕ೖͬͨ͜ͱ͕Θ͔Δ } 9.-1BSTFS%FMFHBUF

Slide 59

Slide 59 text

var isName = false func parser(_ parser: XMLParser, didStartElement elementName: String, namespaceURI: String?, qualifiedName qName: String?, attributes attributeDict: [String : String] = [:]) { // ݱࡏղੳதͷλάΛ൑ఆ if elementName == "໊લ" { isName = true } } func parser(_ parser: XMLParser, foundCharacters string: String) { if isName { text.append(string) } } func parser(_ parser: XMLParser, didEndElement elementName: String, namespaceURI: String?, qualifiedName qName: String?) { // ղੳதϑϥάΛOFF if elementName == "໊લ" { isName = false } } 9.-1BSTFS%FMFHBUF ໊લΛऔಘ

Slide 60

Slide 60 text

344 ෳࡶͳ9.- STTWFSTJPO DIBOOFM UJUMFχϡʔεɾτϐοΫεUJUMF JUFN UJUMF5TVZPTIJIZVHBɺϝΨωΛ৽ௐUJUMF JUFN DIBOOFM STT

Slide 61

Slide 61 text

344 ෳࡶͳ9.- STTWFSTJPO DIBOOFM UJUMFχϡʔεɾτϐοΫεUJUMF JUFN UJUMF5TVZPTIJIZVHBɺϝΨωΛ৽ௐUJUMF JUFN DIBOOFM STT ಉ͡։࢝λά͕͋Γɺ۠ผͰ͖ͳ͍

Slide 62

Slide 62 text

6TJOH.VMUJQMF %FMFHBUFT

Slide 63

Slide 63 text

6TJOH.VMUJQMF%FMFHBUFT ҰͭͷEFMFHBUFॲཧ༻ΫϥεͰॲཧΛϋϯυϦϯά ैདྷͷ%FMFHBUF

Slide 64

Slide 64 text

6TJOH.VMUJQMF%FMFHBUFT λά͝ͱʹEFMFHBUFΦϒδΣΫτΛ࡞ΓɺҠৡ͢Δ λά͝ͱͷ%FMFHBUF

Slide 65

Slide 65 text

9.-1BSTFSͰ%0. 6TJOH.VMUJQMF%FMFHBUFT UJUMFλάΛͦΕͧΕͷΦϒδΣΫτͰղܾ͢Δ

Slide 66

Slide 66 text

&MFNFOU1BSTFS IUUQTHJUIVCDPNDPF&MFNFOU1BSTFS

Slide 67

Slide 67 text

public func parser(_ parser: XMLParser, didStartElement elementName: String, namespaceURI: String?, qualifiedName qName: String?, attributes attributeDict: [String : String] = [:]) { let child = ElementParser(parser: parser, elementName: elementName, attributeDict: attributeDict, parent: self, parentElement: element) childParser = child parser.delegate = child } 9.-1BSTFSͰ%0. 6TJOH.VMUJQMF%FMFHBUFT ։࢝λά͕ݟ͔ͭΔͨͼʹ৽ͨʹΦϒδΣΫτΛ࡞੒͠ɺEFMFHBUFͷର৅Λ੾Γସ͑Δ

Slide 68

Slide 68 text

public func parser(_ parser: XMLParser, didEndElement elementName: String, namespaceURI: String?, qualifiedName qName: String?) { parentParser?.addChild(element) parser.delegate = parentParser } private func addChild(_ child: Element) { element.addElement(child) } 9.-1BSTFSͰ%0. 6TJOH.VMUJQMF%FMFHBUFT λά͕ऴྃͨ͠Β਌ΤϨϝϯτʹ௥Ճ

Slide 69

Slide 69 text

let parser = ElementParser() let xmlParser = XMLParser(data: rss2XmlData) let rss2document: Element = parser.getDocument(from: xmlParser) 9.-1BSTFSͰ%0. 6TJOH.VMUJQMF%FMFHBUFT 344ͷ%0.Λऔಘ

Slide 70

Slide 70 text

σʔλऔಘ

Slide 71

Slide 71 text

let parser = ElementParser() let xmlParser = XMLParser(data: rss2XmlData) let rss2document: Element = parser.getDocument(from: xmlParser) STTWFSTJPO DIBOOFM UJUMFχϡʔεɾτϐοΫεUJUMF JUFN UJUMF5TVZPTIJIZVHBɺϝΨωΛ৽ௐUJUMF JUFN DIBOOFM STT 9.-1BSTFSͰ%0. 6TJOH.VMUJQMF%FMFHBUFT STTEPDVNFOU͔ΒUJUMFΛऔಘ͢Δʹ͸ʁ

Slide 72

Slide 72 text

!EZOBNJD.FNCFS-PPLVQ

Slide 73

Slide 73 text

public class Element { 6TJOH.VMUJQMF%FMFHBUFT !EZOBNJD.FNCFS-PPLVQ

Slide 74

Slide 74 text

@dynamicMemberLookup public class Element { private var _elements: [String: [Element]] public subscript(dynamicMember member: String) -> Element? { return _elements[member]?[0] } 6TJOH.VMUJQMF%FMFHBUFT !EZOBNJD.FNCFS-PPLVQ

Slide 75

Slide 75 text

w !EZOBNJD.FNCFS-PPLVQΛར༻ͨ͠ΞΫηε w !EZOBNJD.FNCFS-PPLVQ͕෇༩͞Ε͍ͯΔ΋ͷ͸ɺఆٛ͠ ͳ͍ϓϩύςΟʹΞΫηεͨ͠ͱͯ͠΋ɺίϯύΠϧΤϥʔʹ ͳΒͳ͍ w TVCTDSJQU EZOBNJD.FNCFSNFNCFS4USJOH Λ࣮ߦͨ͠ ͜ͱʹͳΔ !EZOBNJD.FNCFS-PPLVQ 6TJOH.VMUJQMF%FMFHBUFT

Slide 76

Slide 76 text

let parser = ElementParser() let xmlParser = XMLParser(data: rss2XmlData) let rss2document: Element = parser.getDocument(from: xmlParser) 6TJOH.VMUJQMF%FMFHBUFT !EZOBNJD.FNCFS-PPLVQ

Slide 77

Slide 77 text

let parser = ElementParser() let xmlParser = XMLParser(data: rss2XmlData) let rss2document: Element = parser.getDocument(from: xmlParser) // χϡʔεɾτϐοΫε let channelTitle = rss2document.rss?.channel?.title?.getStringValue() // Tsuyoshi hyugaɺϝΨωΛ৽ௐ let itemTitle = rss2document.rss?.channel?.item?[0]?.title?.getStringValue() 6TJOH.VMUJQMF%FMFHBUFT !EZOBNJD.FNCFS-PPLVQ STTWFSTJPO DIBOOFM UJUMFχϡʔεɾτϐοΫεUJUMF JUFN UJUMF5TVZPTIJIZVHBɺϝΨωΛ৽ௐUJUMF JUFN DIBOOFM STT

Slide 78

Slide 78 text

let atomData = atomXml.data(using: .utf8)! let parser = ElementParser() let xmlParser = XMLParser(data: atomData) let document: Element = parser.getDocument(from: xmlParser) let channelTitle = document.feed?.title?.getStringValue() let itemTitle = document.feed?.entry?[2]?.title?.getStringValue() document.feed?.entry?.getArrayValue()?.forEach({ _ in // ԿΒ͔ͷॲཧ }) 6TJOH.VMUJQMF%FMFHBUFT !EZOBNJD.FNCFS-PPLVQ "UPNGFFE

Slide 79

Slide 79 text

let data = profileXml.data(using: .utf8)! let parser = ElementParser() let xmlParser = XMLParser(data: data) let document: Element = parser.getDocument(from: xmlParser) document.ϓϩϑΟʔϧ?.໊લ?.getStringValue() // ೔޲ڧ document.ϓϩϑΟʔϧ?.޷͖ͳ3DO?.getStringValue() // REAL document.ϓϩϑΟʔϧ?.ओͳ࣮੷?.getStringValue() // nil 6TJOH.VMUJQMF%FMFHBUFT !EZOBNJD.FNCFS-PPLVQ ϓϩϑΟʔϧ

Slide 80

Slide 80 text

9.-1BSTFSͷͦͷଞͷػೳ

Slide 81

Slide 81 text

໊લۭؒ

Slide 82

Slide 82 text

໊લۭؒ 344 SEG3%'YNMOTIUUQQVSMPSHSTTYNMOTSEGIUUQXXXXPSHSEGTZOUBYOTYNMOTEDIUUQQVSMPSH EDFMFNFOUTYNMOTNOIUUQVTFGVMJODDPNSTTNBOJGFTUYNMMBOHKB DIBOOFM UJUMF೔هUJUMF ʜ DIBOOFM ʜ JUFNSEGBCPVUIUUQTFYBNQMFBSUJDMF UJUMFλΠτϧUJUMF MJOLIUUQTHJIZPKQFYBNQMFBSUJDMFMJOL EFTDSJQUJPOίϯςϯπͷઆ໌Ͱ͢EFTDSJQUJPO EDEBUF5EDEBUF EDTVCKFDUϗοτϥΠϯEDTVCKFDU EDDSFBUPSUTVZPTIJIZVHBEDDSFBUPS JUFN SEG3%'

Slide 83

Slide 83 text

໊લۭؒ 344 SEG3%'YNMOTIUUQQVSMPSHSTTYNMOTSEGIUUQXXXXPSHSEGTZOUBYOTYNMOTEDIUUQ QVSMPSHEDFMFNFOUTYNMOTNOIUUQVTFGVMJODDPNSTTNBOJGFTUYNMMBOHKB DIBOOFM UJUMF೔هUJUMF ʜ DIBOOFM ʜ JUFNSEGBCPVUIUUQTFYBNQMFBSUJDMF UJUMFλΠτϧUJUMF MJOLIUUQTHJIZPKQFYBNQMFBSUJDMFMJOL EFTDSJQUJPOίϯςϯπͷઆ໌Ͱ͢EFTDSJQUJPO EDEBUF5EDEBUF EDTVCKFDUϗοτϥΠϯEDTVCKFDU EDDSFBUPSUTVZPTIJIZVHBEDDSFBUPS JUFN SEG3%' EDͷ໊લۭؒఆٛ

Slide 84

Slide 84 text

໊લۭؒ 344 SEG3%'YNMOTIUUQQVSMPSHSTTYNMOTSEGIUUQXXXXPSHSEGTZOUBYOTYNMOTEDIUUQ QVSMPSHEDFMFNFOUTYNMOTNOIUUQVTFGVMJODDPNSTTNBOJGFTUYNMMBOHKB DIBOOFM UJUMF೔هUJUMF ʜ DIBOOFM ʜ JUFNSEGBCPVUIUUQTFYBNQMFBSUJDMF UJUMFλΠτϧUJUMF MJOLIUUQTHJIZPKQFYBNQMFBSUJDMFMJOL EFTDSJQUJPOίϯςϯπͷઆ໌Ͱ͢EFTDSJQUJPO EDEBUF5EDEBUF EDTVCKFDUϗοτϥΠϯEDTVCKFDU EDDSFBUPSUTVZPTIJIZVHBEDDSFBUPS JUFN SEG3%' ໊લۭؒ63-EDʹଐ͢Δ

Slide 85

Slide 85 text

໊લۭؒ 9.-1BSTFS

Slide 86

Slide 86 text

w TIPVME1SPDFTT/BNFTQBDFT w TIPVME3FQPSU/BNFTQBDF1SF fi YFT 9.-1BSTFS ໊લۭؒ

Slide 87

Slide 87 text

shouldProcessNamespaces IUUQTEFWFMPQFSBQQMFDPNEPDVNFOUBUJPOGPVOEBUJPOOTYNMQBSTFSTIPVMEQSPDFTTOBNFTQBDFT

Slide 88

Slide 88 text

w σϑΥϧτ͸GBMTF w USVFʹ͢Δͱɺ9.-1BSTFS%FMFHBUFͷҎԼͷGVODͷಈ࡞͕มΘ Δ w QBSTFS @EJE4UBSU&MFNFOUOBNFTQBDF63*RVBMJ fi FE/B NFBUUSJCVUFT w QBSTFS @EJE&OE&MFNFOUOBNFTQBDF63*RVBMJ fi FE/B NF TIPVME1SPDFTT/BNFTQBDFT ໊લۭؒ

Slide 89

Slide 89 text

TIPVME1SPDFTT/BNFTQBDFT ໊લۭؒॲཧ '"-4& %FGBVMU 536& FMFNFOU/BNF EDEBUF EBUF OBNFTQBDF63* OJM IUUQQVSMPSHEDFMFNFOUT R/BNF OJM EDEBUF SEG3%'YNMOTIUUQQVSMPSHSTTYNMOTSEGIUUQXXXXPSHSEGTZOUBYOTYNMOTEDIUUQ QVSMPSHEDFMFNFOUTYNMOTNOIUUQVTFGVMJODDPNSTTNBOJGFTUYNMMBOHKB DIBOOFM UJUMF೔هUJUMF ʜ DIBOOFM ʜ JUFNSEGBCPVUIUUQTFYBNQMFBSUJDMF UJUMFλΠτϧUJUMF MJOLIUUQTHJIZPKQFYBNQMFBSUJDMFMJOL EFTDSJQUJPOίϯςϯπͷઆ໌Ͱ͢EFTDSJQUJPO EDEBUF5EDEBUF EDTVCKFDUϗοτϥΠϯEDTVCKFDU EDDSFBUPSUTVZPTIJIZVHBEDDSFBUPS JUFN SEG3%'

Slide 90

Slide 90 text

shouldReportNamespacePrefixes IUUQTEFWFMPQFSBQQMFDPNEPDVNFOUBUJPOGPVOEBUJPOYNMQBSTFSTIPVMESFQPSUOBNFTQBDFQSF fi YFT

Slide 91

Slide 91 text

w σϑΥϧτ͸GBMTF w USVFʹ͢Δͱɺ9.-1BSTFS%FMFHBUFͰ৽ͨͳϝιου͕ίʔϧ ͞ΕΔΑ͏ʹͳΔ w QBSTFS @EJE4UBSU.BQQJOH1SF fi YUP63* w QBSTFS @EJE&OE.BQQJOH1SF fi Y w ໊લۭؒఆٛΛಡΈࠐΜͩͱ͖ʹݺ͹ΕΔ TIPVME3FQPSU/BNFTQBDF1SF fi YFT ໊લۭؒ

Slide 92

Slide 92 text

υΩϡϝϯτʹ࢖͍ํ͕ॻ͍ͯ͋Δ

Slide 93

Slide 93 text

%5%

Slide 94

Slide 94 text

l%PDVNFOU5ZQF%FGJOJUJPOʢจॻܕఆٛɺ%5%ʣͱ͸ɺϚ ʔΫΞοϓݴޠͷ4(.-͓Αͼ9.-ʹ͓͍ͯɺจॻߏ଄ ʢจॻܕʣΛఆٛ͢ΔͨΊͷεΩʔϚݴޠͷҰͭͰ͋Δɻz ʮ%PDVNFOU5ZQF%F fi OJUJPOʯʢ೥݄೔ Ր ɹ65$ͷ൛ʣʰ΢ΟΩϖσΟΞ೔ຊޠ൛ʱɻ IUUQTKBXJLJQFEJBPSHXJLJ%PDVNFOU@5ZQF@%F fi OJUJPO

Slide 95

Slide 95 text

%5%

Slide 96

Slide 96 text

ϔϧεέΞͷ9.-%5%ൈਮ %5% %0$5:1&)FBMUI%BUB< )FBMUI,JU&YQPSU7FSTJPO &-&.&/5)FBMUI%BUB &YQPSU%BUF .F 3FDPSEc$PSSFMBUJPOc8PSLPVUc"DUJWJUZ4VNNBSZc$MJOJDBM3FDPSE "55-*45)FBMUI%BUB MPDBMF$%"5"3&26*3&% &-&.&/5&YQPSU%BUF&.15: "55-*45&YQPSU%BUF WBMVF$%"5"3&26*3&% &-&.&/5.F&.15: "55-*45.F ),$IBSBDUFSJTUJD5ZQF*EFOUJ fi FS%BUF0G#JSUI$%"5"3&26*3&% ),$IBSBDUFSJTUJD5ZQF*EFOUJ fi FS#JPMPHJDBM4FY$%"5"3&26*3&% ),$IBSBDUFSJTUJD5ZQF*EFOUJ fi FS#MPPE5ZQF$%"5"3&26*3&% ),$IBSBDUFSJTUJD5ZQF*EFOUJ fi FS'JU[QBUSJDL4LJO5ZQF$%"5"3&26*3&% >

Slide 97

Slide 97 text

w &-&.&/5 w "55-*45 %PDVNFOU5ZQF%F fi OJUJPO %5%

Slide 98

Slide 98 text

w &-&.&/5 w "55-*45 w &/5*5: w /05"5*0/ %PDVNFOU5ZQF%F fi OJUJPO %5%

Slide 99

Slide 99 text

9.-1BSTFS%FMFHBUF΋ ରԠ͍ͯ͠Δ

Slide 100

Slide 100 text

IUUQTEFWFMPQFSBQQMFDPNEPDVNFOUBUJPOGPVOEBUJPOYNMQBSTFSEFMFHBUF

Slide 101

Slide 101 text

&-&.&/5 "55-*45

Slide 102

Slide 102 text

&-&.&/5"55-*45 %5% &-&.&/53FDPSE .FUBEBUB&OUSZc)FBSU3BUF7BSJBCJMJUZ.FUBEBUB-JTU "55-*453FDPSE UZQF$%"5"3&26*3&% VOJU$%"5"*.1-*&% WBMVF$%"5"*.1-*&% TPVSDF/BNF$%"5"3&26*3&% TPVSDF7FSTJPO$%"5"*.1-*&% EFWJDF$%"5"*.1-*&% DSFBUJPO%BUF$%"5"*.1-*&% TUBSU%BUF$%"5"3&26*3&% FOE%BUF$%"5"3&26*3&%

Slide 103

Slide 103 text

&-&.&/5"55-*45 %5% &-&.&/53FDPSE .FUBEBUB&OUSZc)FBSU3BUF7BSJBCJMJUZ.FUBEBUB-JTU "55-*453FDPSE UZQF$%"5"3&26*3&% VOJU$%"5"*.1-*&% WBMVF$%"5"*.1-*&% TPVSDF/BNF$%"5"3&26*3&% TPVSDF7FSTJPO$%"5"*.1-*&% EFWJDF$%"5"*.1-*&% DSFBUJPO%BUF$%"5"*.1-*&% TUBSU%BUF$%"5"3&26*3&% FOE%BUF$%"5"3&26*3&% 3FDPSEUZQF),2VBOUJUZ5ZQF*EFOUJ fi FS#MPPE(MVDPTFTPVSDF/BNFϔϧεέΞTPVSDF7FSTJPOVOJUNHE- DSFBUJPO%BUFTUBSU%BUFFOE%BUF WBMVF .FUBEBUB&OUSZLFZ),8BT6TFS&OUFSFEWBMVF 3FDPSE

Slide 104

Slide 104 text

&-&.&/5 %5% &-&.&/53FDPSE .FUBEBUB&OUSZc)FBSU3BUF7BSJBCJMJUZ.FUBEBUB-JTU "55-*453FDPSE UZQF$%"5"3&26*3&% VOJU$%"5"*.1-*&% WBMVF$%"5"*.1-*&% TPVSDF/BNF$%"5"3&26*3&% TPVSDF7FSTJPO$%"5"*.1-*&% EFWJDF$%"5"*.1-*&% DSFBUJPO%BUF$%"5"*.1-*&% TUBSU%BUF$%"5"3&26*3&% FOE%BUF$%"5"3&26*3&% 3FDPSEUZQF),2VBOUJUZ5ZQF*EFOUJ fi FS#MPPE(MVDPTFTPVSDF/BNFϔϧεέΞTPVSDF7FSTJPOVOJUNHE- DSFBUJPO%BUFTUBSU%BUFFOE%BUF WBMVF .FUBEBUB&OUSZLFZ),8BT6TFS&OUFSFEWBMVF 3FDPSE

Slide 105

Slide 105 text

"55-*45 %5% &-&.&/53FDPSE .FUBEBUB&OUSZc)FBSU3BUF7BSJBCJMJUZ.FUBEBUB-JTU "55-*453FDPSE UZQF$%"5"3&26*3&% VOJU$%"5"*.1-*&% WBMVF$%"5"*.1-*&% TPVSDF/BNF$%"5"3&26*3&% TPVSDF7FSTJPO$%"5"*.1-*&% EFWJDF$%"5"*.1-*&% DSFBUJPO%BUF$%"5"*.1-*&% TUBSU%BUF$%"5"3&26*3&% FOE%BUF$%"5"3&26*3&% 3FDPSEUZQF),2VBOUJUZ5ZQF*EFOUJ fi FS#MPPE(MVDPTFTPVSDF/BNFϔϧεέΞTPVSDF7FSTJPOVOJUNH E-DSFBUJPO%BUFTUBSU%BUFFOE%BUF WBMVF .FUBEBUB&OUSZLFZ),8BT6TFS&OUFSFEWBMVF 3FDPSE

Slide 106

Slide 106 text

w &-&.&/5 w "55-*45 w 9.-ͷܗΛఆ͍ٛͯ͠Δ w ఆ͔ٛΒɺ9.-͕ଥ౰͔όϦσʔγϣϯνΣοΫͰ͖Δ &-&.&/5"55-*45 %5%

Slide 107

Slide 107 text

QBSTFS @GPVOE&MFNFOU%FDMBSBUJPO8JUI/BNFNPEFM IUUQTEFWFMPQFSBQQMFDPNEPDVNFOUBUJPOGPVOEBUJPOYNMQBSTFSEFMFHBUFQBSTFS

Slide 108

Slide 108 text

optional func parser( _ parser: XMLParser, foundElementDeclarationWithName elementName: String, model: String ) &-&.&/5ղੳ༻9.-1BSTFS%FMFHBUF QBSTFS @GPVOE&MFNFOU%FDMBSBUJPO8JUI/BNFNPEFM parser An NSXMLParser object parsing XML. elementName A string that is the name of an element. model A string that specifies a model for elementName.

Slide 109

Slide 109 text

&-&.&/5ղੳ༻9.-1BSTFS%FMFHBUF QBSTFS @GPVOE&MFNFOU%FDMBSBUJPO8JUI/BNFNPEFM parser An NSXMLParser object parsing XML. elementName A string that is the name of an element. model A string that specifies a model for elementName. &-&.&/53FDPSE .FUBEBUB&OUSZc)FBSU3BUF7BSJBCJMJUZ.FUBEBUB-JTU

Slide 110

Slide 110 text

&-&.&/5ղੳ༻9.-1BSTFS%FMFHBUF QBSTFS @GPVOE&MFNFOU%FDMBSBUJPO8JUI/BNFNPEFM parser An NSXMLParser object parsing XML. elementName A string that is the name of an element. model A string that specifies a model for elementName. &-&.&/53FDPSE .FUBEBUB&OUSZc)FBSU3BUF7BSJBCJMJUZ.FUBEBUB-JTU

Slide 111

Slide 111 text

&-&.&/5ղੳ༻9.-1BSTFS%FMFHBUF QBSTFS @GPVOE&MFNFOU%FDMBSBUJPO8JUI/BNFNPEFM parser An NSXMLParser object parsing XML. elementName A string that is the name of an element. model A string that specifies a model for elementName. &-&.&/53FDPSE .FUBEBUB&OUSZc)FBSU3BUF7BSJBCJMJUZ.FUBEBUB-JTU

Slide 112

Slide 112 text

υΩϡϝϯτʹࡌ͍ͬͯ ͳ͍෦෼

Slide 113

Slide 113 text

optional func parser( _ parser: XMLParser, foundElementDeclarationWithName elementName: String, model: String ) &-&.&/5ղੳ༻9.-1BSTFS%FMFHBUF QBSTFS @GPVOE&MFNFOU%FDMBSBUJPO8JUI/BNFNPEFM &-&.&/53FDPSE .FUBEBUB&OUSZc)FBSU3BUF7BSJBCJMJUZ.FUBEBUB-JTU ༧૝ FMFNFOU/BNF 3FDPSE NPEFM .FUBEBUB&OUSZc)FBSU3BUF7BSJBCJMJUZ.FUBEBUB-JTU

Slide 114

Slide 114 text

optional func parser( _ parser: XMLParser, foundElementDeclarationWithName elementName: String, model: String ) &-&.&/5ղੳ༻9.-1BSTFS%FMFHBUF QBSTFS @GPVOE&MFNFOU%FDMBSBUJPO8JUI/BNFNPEFM &-&.&/53FDPSE .FUBEBUB&OUSZc)FBSU3BUF7BSJBCJMJUZ.FUBEBUB-JTU ༧૝ ࣮ࡍ FMFNFOU/BNF 3FDPSE 3FDPSE NPEFM .FUBEBUB&OUSZc)FBSU3BUF7BSJBCJMJUZ.FUBEBUB-JTU ۭจࣈ

Slide 115

Slide 115 text

IUUQTEFWFMPQFSBQQMFDPNGPSVNTUISFBE

Slide 116

Slide 116 text

QBSTFS @GPVOE"UUSJCVUF%FDMBSBUJPO8JUI/BNFGPS&MFNFOUUZQFEFGBVMU7BMVF IUUQTEFWFMPQFSBQQMFDPNEPDVNFOUBUJPOGPVOEBUJPOYNMQBSTFSEFMFHBUFQBSTFS

Slide 117

Slide 117 text

optional func parser( _ parser: XMLParser, foundAttributeDeclarationWithName attributeName: String, forElement elementName: String, type: String?, defaultValue: String? ) "55-*45ղੳ༻9.-1BSTFS%FMFHBUF QBSTFS @GPVOE"UUSJCVUF%FDMBSBUJPO8JUI/BNFGPS&MFNFOUUZQFEFGBVMU7B MVF parser An NSXMLParser object parsing XML. attributeName A string that is the name of an attribute. elementName A string that is the name of an element that has the attribute attributeName. type A string, such as "ENTITY", "NOTATION", or "ID", that indicates the type of the attribute. defaultValue A string that specifies the default value of the attribute.

Slide 118

Slide 118 text

"55-*45ղੳ༻9.-1BSTFS%FMFHBUF QBSTFS @GPVOE"UUSJCVUF%FDMBSBUJPO8JUI/BNFGPS&MFNFOUUZQFEFGBVMU7B MVF parser An NSXMLParser object parsing XML. attributeName A string that is the name of an attribute. elementName A string that is the name of an element that has the attribute attributeName. type A string, such as "ENTITY", "NOTATION", or "ID", that indicates the type of the attribute. defaultValue A string that specifies the default value of the attribute. "55-*45TRVBSFXJEUI$%"5"

Slide 119

Slide 119 text

"55-*45ղੳ༻9.-1BSTFS%FMFHBUF QBSTFS @GPVOE"UUSJCVUF%FDMBSBUJPO8JUI/BNFGPS&MFNFOUUZQFEFGBVMU7B MVF parser An NSXMLParser object parsing XML. attributeName A string that is the name of an attribute. elementName A string that is the name of an element that has the attribute attributeName. type A string, such as "ENTITY", "NOTATION", or "ID", that indicates the type of the attribute. defaultValue A string that specifies the default value of the attribute. "55-*45TRVBSFXJEUI$%"5" ͭͷ஋͕ͦΕͧΕͷύϥϝʔλʹͳ͍ͬͯΔ

Slide 120

Slide 120 text

υΩϡϝϯτʹࡌ͍ͬͯ ͳ͍෦෼

Slide 121

Slide 121 text

"55-*45ղੳ༻9.-1BSTFS%FMFHBUF QBSTFS @GPVOE"UUSJCVUF%FDMBSBUJPO8JUI/BNFGPS&MFNFOUUZQFEFGBVMU7B MVF ༧૝ BUUSJCVUF/BNF XJEUI FMFNFOU/BNF TRVBSF UZQF $%"5" EFGBVMU7BMVF optional func parser( _ parser: XMLParser, foundAttributeDeclarationWithName attributeName: String, forElement elementName: String, type: String?, defaultValue: String? ) "55-*45TRVBSFXJEUI$%"5"

Slide 122

Slide 122 text

"55-*45ղੳ༻9.-1BSTFS%FMFHBUF QBSTFS @GPVOE"UUSJCVUF%FDMBSBUJPO8JUI/BNFGPS&MFNFOUUZQFEFGBVMU7B MVF ༧૝ ݁Ռ BUUSJCVUF/BNF XJEUI XJEUI FMFNFOU/BNF TRVBSF TRVBSF UZQF $%"5" ۭจࣈ EFGBVMU7BMVF optional func parser( _ parser: XMLParser, foundAttributeDeclarationWithName attributeName: String, forElement elementName: String, type: String?, defaultValue: String? ) "55-*45TRVBSFXJEUI$%"5"

Slide 123

Slide 123 text

"55-*45ղੳ༻9.-1BSTFS%FMFHBUF QBSTFS @GPVOE"UUSJCVUF%FDMBSBUJPO8JUI/BNFGPS&MFNFOUUZQFEFGBVMU7B MVF ༧૝ ࣮ࡍ BUUSJCVUF/BNF XJEUI XJEUI FMFNFOU/BNF TRVBSF TRVBSF UZQF $%"5" ۭจࣈ EFGBVMU7BMVF 3&26*3&% OJM optional func parser( _ parser: XMLParser, foundAttributeDeclarationWithName attributeName: String, forElement elementName: String, type: String?, defaultValue: String? ) "55-*45TRVBSFXJEUI$%"5"3&26*3&%

Slide 124

Slide 124 text

&/5*5:

Slide 125

Slide 125 text

w ಺෦&/5*5: w ֎෦&/5*5: &/5*5: %5%

Slide 126

Slide 126 text

಺෦&/5*5: &/5*5: CPPLTOBNFॻ੶৘ใ CPPL UJUMFࡾ࢛࿠UJUMF BVUIPSՆ໨ᕸੴBVUIPS CPPL CPPL UJUMFͦΕ͔ΒUJUMF BVUIPSՆ໨ᕸੴBVUIPS CPPL CPPL UJUMF໳UJUMF BVUIPSՆ໨ᕸੴBVUIPS CPPL CPPLT

Slide 127

Slide 127 text

಺෦&/5*5: &/5*5: CPPLTOBNFॻ੶৘ใ CPPL UJUMFࡾ࢛࿠UJUMF BVUIPSՆ໨ᕸੴBVUIPS CPPL CPPL UJUMFͦΕ͔ΒUJUMF BVUIPSՆ໨ᕸੴBVUIPS CPPL CPPL UJUMF໳UJUMF BVUIPSՆ໨ᕸੴBVUIPS CPPL CPPLT ಉ͡࡞ऀ໊ͷ࡞඼͕ฒΜͰ͍Δ

Slide 128

Slide 128 text

಺෦&/5*5: &/5*5: YNMWFSTJPOFODPEJOH65' %0$5:1&CPPLT< &/5*5:BVUIPSՆ໨ᕸੴ > CPPLTOBNFॻ੶৘ใ CPPL UJUMFࡾ࢛࿠UJUMF BVUIPSBVUIPSBVUIPS CPPL CPPL UJUMFͦΕ͔ΒUJUMF BVUIPSBVUIPSBVUIPS CPPL CPPL UJUMF໳UJUMF BVUIPSBVUIPSBVUIPS CPPL CPPLT ಺෦&/5*5:Ͱஔ͖׵͑

Slide 129

Slide 129 text

No content

Slide 130

Slide 130 text

಺෦&/5*5:ͷ 9.-1BSTFSղੳ

Slide 131

Slide 131 text

optional func parser( _ parser: XMLParser, foundInternalEntityDeclarationWithName name: String, value: String? ) ಺෦&/5*5:ղੳ༻9.-1BSTFS%FMFHBUF QBSTFS @GPVOE*OUFSOBM&OUJUZ%FDMBSBUJPO8JUI/BNFWBMVF parser An NSXMLParser object parsing XML. name A string that is the declared name of an internal entity. value A string that is the value of entity name.

Slide 132

Slide 132 text

಺෦&/5*5:ղੳ༻9.-1BSTFS%FMFHBUF QBSTFS @GPVOE*OUFSOBM&OUJUZ%FDMBSBUJPO8JUI/BNFWBMVF ༧૝ ࣮ࡍ OBNF BVUIPS BVUIPS WBMVF Ն໨ᕸੴ Ն໨ᕸੴ &/5*5:BVUIPSՆ໨ᕸੴ optional func parser( _ parser: XMLParser, foundInternalEntityDeclarationWithName name: String, value: String? )

Slide 133

Slide 133 text

ٙ໰

Slide 134

Slide 134 text

಺෦&/5*5: &/5*5: CPPLTOBNFॻ੶৘ใ CPPL UJUMFࡾ࢛࿠UJUMF BVUIPSBVUIPSBVUIPS CPPL CPPL UJUMFͦΕ͔ΒUJUMF BVUIPSBVUIPSBVUIPS CPPL CPPL UJUMF໳UJUMF BVUIPSBVUIPSBVUIPS CPPL CPPLT

Slide 135

Slide 135 text

಺෦&/5*5: &/5*5: func parser(_ parser: XMLParser, foundCharacters string: String) { print(string) } ಺༰͸Ͳ͏ग़ྗ͞ΕΔʁ CPPLTOBNFॻ੶৘ใ CPPL UJUMFࡾ࢛࿠UJUMF BVUIPSBVUIPSBVUIPS CPPL CPPL UJUMFͦΕ͔ΒUJUMF BVUIPSBVUIPSBVUIPS CPPL CPPL UJUMF໳UJUMF BVUIPSBVUIPSBVUIPS CPPL CPPLT

Slide 136

Slide 136 text

಺෦&/5*5: &/5*5: func parser(_ parser: XMLParser, foundCharacters string: String) { print(string) // Ն໨ᕸੴ } ಺༰͸Ͳ͏ग़ྗ͞ΕΔʁ CPPLTOBNFॻ੶৘ใ CPPL UJUMFࡾ࢛࿠UJUMF BVUIPSBVUIPSBVUIPS CPPL CPPL UJUMFͦΕ͔ΒUJUMF BVUIPSBVUIPSBVUIPS CPPL CPPL UJUMF໳UJUMF BVUIPSBVUIPSBVUIPS CPPL CPPLT

Slide 137

Slide 137 text

಺෦&/5*5: &/5*5: func parser(_ parser: XMLParser, foundCharacters string: String) { print(string) // &author; } ಺༰͸Ͳ͏ग़ྗ͞ΕΔʁ CPPLTOBNFॻ੶৘ใ CPPL UJUMFࡾ࢛࿠UJUMF BVUIPSBVUIPSBVUIPS CPPL CPPL UJUMFͦΕ͔ΒUJUMF BVUIPSBVUIPSBVUIPS CPPL CPPL UJUMF໳UJUMF BVUIPSBVUIPSBVUIPS CPPL CPPLT

Slide 138

Slide 138 text

ਖ਼ղ

Slide 139

Slide 139 text

಺෦&/5*5: &/5*5: func parser(_ parser: XMLParser, foundCharacters string: String) { print(string) // \n } վߦจࣈ͕͘Δˠม׵Ͱ͖ͳ͍ CPPLTOBNFॻ੶৘ใ CPPL UJUMFࡾ࢛࿠UJUMF BVUIPSBVUIPSBVUIPS CPPL CPPL UJUMFͦΕ͔ΒUJUMF BVUIPSBVUIPSBVUIPS CPPL CPPL UJUMF໳UJUMF BVUIPSBVUIPSBVUIPS CPPL CPPLT

Slide 140

Slide 140 text

֎෦&/5*5:

Slide 141

Slide 141 text

֎෦&/5*5: &/5*5: YNMWFSTJPOFODPEJOHVUG %0$5:1&UFTU< &/5*5:FYUFSOBM4:45&.VTFS fi MFYNM > UFTUFYUFSOBMUFTU

Slide 142

Slide 142 text

֎෦&/5*5: &/5*5: YNMWFSTJPOFODPEJOHVUG %0$5:1&UFTU< &/5*5:FYUFSOBM4:45&.VTFS fi MFYNM > UFTUFYUFSOBMUFTU ࢦఆ͞Εͨύεͷ಺༰ʹஔ͖׵ΘΔ

Slide 143

Slide 143 text

9.-1BSTFSͰͷ֎෦ &/5*5:

Slide 144

Slide 144 text

optional func parser( _ parser: XMLParser, foundExternalEntityDeclarationWithName name: String, publicID: String?, systemID: String? ) ֎෦&/5*5:ղੳ༻9.-1BSTFS%FMFHBUF QBSTFS @GPVOE&YUFSOBM&OUJUZ%FDMBSBUJPO8JUI/BNFQVCMJD*%TZTUFN*%

Slide 145

Slide 145 text

֎෦&/5*5:Λύʔε͠ ͯΈΔ

Slide 146

Slide 146 text

9.-1BSTFSͰͷ֎෦&/5*5: &/5*5: YNMWFSTJPOFODPEJOHVUG %0$5:1&UFTU< &/5*5:FYUFSOBM4:45&.VTFS fi MFYNM > UFTUFYUFSOBMUFTU

Slide 147

Slide 147 text

9.-1BSTFSͰͷ֎෦&/5*5: &/5*5: YNMWFSTJPOFODPEJOHVUG %0$5:1&UFTU< &/5*5:FYUFSOBM4:45&.VTFS fi MFYNM > UFTUFYUFSOBMUFTU func parser(_ parser: XMLParser, parseErrorOccurred parseError: Error) { print(#function, #line, "parseError", parseError) } parser(_:parseErrorOccurred:) 45 parseError Error Domain=NSXMLParserErrorDomain Code=104 "(null)" UserInfo={NSXMLParserErrorColumn=17, NSXMLParserErrorLineNumber=5, NSXMLParserErrorMessage=Failure to process entity external }

Slide 148

Slide 148 text

֎෦&/5*5:͸ಈ͔ͳ ͍ʁ

Slide 149

Slide 149 text

ಈ͖·͢ʂ

Slide 150

Slide 150 text

externalEntityResolvingPolicy IUUQTEFWFMPQFSBQQMFDPNEPDVNFOUBUJPOGPVOEBUJPOYNMQBSTFSFYUFSOBMFOUJUZSFTPMWJOHQPMJDZ

Slide 151

Slide 151 text

/PPWFSWJFXBWBJMBCMF

Slide 152

Slide 152 text

switch xmlParser.externalEntityResolvingPolicy { case .never: print("never") // ← Default case .noNetwork: print("noNetwork") case .sameOriginOnly: print("sameOriginOnly") case .always: print("always") @unknown default: print("default") } 9.-1BSTFSͰ%0. 6TJOH.VMUJQMF%FMFHBUFT σϑΥϧτͰ͸OFWFS͕ઃఆ͞Ε͍ͯΔ

Slide 153

Slide 153 text

switch xmlParser.externalEntityResolvingPolicy { case .never: print("never") // ← Default case .noNetwork: print("noNetwork") case .sameOriginOnly: print("sameOriginOnly") case .always: print("always") @unknown default: print("default") } xmlParser.externalEntityResolvingPolicy = .noNetwork // or .always 9.-1BSTFSͰ%0. 6TJOH.VMUJQMF%FMFHBUFT ֎෦&OUJUZ͕ fi MFͷ৔߹ɺOP/FUXPSL΍BMXBZTʹઃఆ͢Δ

Slide 154

Slide 154 text

9.-1BSTFSͰͷ֎෦&/5*5: &/5*5: YNMWFSTJPOFODPEJOHVUG %0$5:1&UFTU< &/5*5:FYUFSOBM4:45&.VTFS fi MFYNM > UFTUFYUFSOBMUFTU JUFN UJUMFχϡʔελΠτϧUJUMF MJOLIUUQTFYBNQMFDPN MJOL QVC%BUF'SJ .BZ (.5QVC%BUF EFTDSJQUJPOχϡʔεهࣄ EFTDSJQUJPO DPNNFOUTIUUQT FYBNQMFDPNDPNNFOUT DPNNFOUT JUFN VTFS fi MFYNM

Slide 155

Slide 155 text

9.-1BSTFSͰͷ֎෦&/5*5: &/5*5: YNMWFSTJPOFODPEJOHVUG UFTU JUFN UJUMFχϡʔελΠτϧUJUMF MJOLIUUQTFYBNQMFDPNMJOL QVC%BUF'SJ .BZ (.5QVC%BUF EFTDSJQUJPOχϡʔεهࣄ EFTDSJQUJPO DPNNFOUTIUUQT FYBNQMFDPNDPNNFOUTDPNNFOUT JUFN UFTU JUFN UJUMFχϡʔελΠτϧUJUMF MJOLIUUQTFYBNQMFDPN MJOL QVC%BUF'SJ .BZ (.5QVC%BUF EFTDSJQUJPOχϡʔεهࣄ EFTDSJQUJPO DPNNFOUTIUUQT FYBNQMFDPNDPNNFOUT DPNNFOUT JUFN ֎෦ϑΝΠϧͷ಺༰ʹஔ͖׵ΘΔ VTFS fi MFYNM

Slide 156

Slide 156 text

͍͢͝ʂ

Slide 157

Slide 157 text

੍ݶ

Slide 158

Slide 158 text

9.-1BSTFSͰͷ֎෦&/5*5: &/5*5: YNMWFSTJPOFODPEJOHVUG %0$5:1&UFTU< &/5*5:FYUFSOBM4:45&.QBUIUP > UFTUFYUFSOBMUFTU w γϛϡϨʔλ͡Όͳ͍ͱಈ࡞Λ֬ೝͰ͖͍ͯͳ͍ w ։ൃ͍ͯ͠Δ.BDͷύεʹϑΝΠϧΛஔ͘ඞཁ͕͋Δ

Slide 159

Slide 159 text

9.-1BSTFSͰͷ֎෦&/5*5: &/5*5: YNMWFSTJPOFODPEJOHVUG %0$5:1&UFTU< &/5*5:FYUFSOBM4:45&.IUUQTFYBNQMFDPNUNQYNM > UFTUFYUFSOBMUFTU w ωοτϫʔΫͷύεʹؔͯ͠͸ɺͲͷ FYUFSOBM&OUJUZ3FTPMWJOH1PMJDZΛઃఆͯ͠΋ಡΈࠐΊͳ͍

Slide 160

Slide 160 text

BMMPXFE&YUFSOBM&OUJUZ63-T IUUQTEFWFMPQFSBQQMFDPNEPDVNFOUBUJPOGPVOEBUJPOYNMQBSTFSBMMPXFEFYUFSOBMFOUJUZVSMT ͜ΕΛઃఆͯ͠΋μϝͰͨ͠

Slide 161

Slide 161 text

/PPWFSWJFXBWBJMBCMF

Slide 162

Slide 162 text

w J04Ͱ͸9.-1BSTFSΛ࢖͏ w %0.༻ͷ9.-%PDVNFOU͸J04Ͱ͸ղ์͞Ε͍ͯͳ͍ w ڊେͳ9.-ͷύʔε͸ඞཁͳσʔλ͚ͩ9.-1BSTFSͰऔಘ͢Δ w ඞཁແ͘ͳͬͨΒ"CPSU w ෳࡶͳ9.-ͷղੳʹ͸6TJOH.VMUJQMF%FMFHBUFT w 9.-1BSTFSͷ%5%αϙʔτ͸ߟ͑ͳ͍ํ͕͍͍ ྩ࿨࣌୅ͷ9.-ॲཧΛߟ͑Δ ·ͱΊ

Slide 163

Slide 163 text

l*OUSPEVDUJPOUP&WFOU%SJWFO9.- 1SPHSBNNJOH(VJEFGPS$PDPBz IUUQTEFWFMPQFSBQQMFDPNMJCSBSZBSDIJWFEPDVNFOUBUJPO$PDPB $PODFQUVBM9.-1BSTJOH9.-1BSTJOHIUNMBQQMF@SFGEPDVJE