-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathnewxml.txt
executable file
·108 lines (74 loc) · 2.36 KB
/
newxml.txt
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
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
let xxaexonEventAttributes = [ "AeonNoteType",
"NoteStatus",
"ID",
"Locked",
"Title",
"AllDay",
"StartDate",
"Description",
"IncludeInExport",
"Label",
"Arc",
"Relationships",
"Tags",
"Completed",
"Duration",
"DurationUnit",
"ShowTime",
"ShowDay",
"ShowMonth",
"ExternalLinks"
]
http://natashatherobot.com/swift-string-ranges-the-functional/
children of an event
<item ID="1436008882" Creator="prenez" proto="AeonRelationshipsPrototype" >
<attribute name="AeonEventRelationshipNoteType" >AeonRelationship</attribute>
<attribute name="Created" >2015-07-11T17:06:51-04:00</attribute>
<attribute name="Modified" >2015-07-11T17:06:51-04:00</attribute>
<attribute name="Name" >Relationship: Catherine Earnshaw;Observer</attribute>
<attribute name="SelectionCount" >1</attribute>
<attribute name="Xpos" >7.925170898</attribute>
<attribute name="Ypos" >-1.553881836</attribute>
</item>
<item ID="1436008883" Creator="prenez" proto="AeonTagsPrototype" >
<attribute name="AeonEventTagNoteType" >AeonTag</attribute>
<attribute name="Created" >2015-07-11T17:06:51-04:00</attribute>
<attribute name="Modified" >2015-07-11T17:06:51-04:00</attribute>
<attribute name="Name" >Tag: Death</attribute>
<attribute name="SelectionCount" >1</attribute>
<attribute name="Xpos" >-1.074829102</attribute>
<attribute name="Ypos" >19.77888184</attribute>
</item>
</item>
else { // its not an attribute element, either an adorument, relationship or tag
// an adornment
// a relationship
// a tag
// a text
// so this is the matching algo
var foundARelationship = false
var tbxRelationshipString = ""
if let aPrototype = tbxItemAeElementChildB.attributes["proto"] {
if tbxItemAeElementChildB.name == "item" {
//&& tbxItemAeElementChildB.attributes["proto"]!.name == "AeonRelationshipsPrototype" {
for tbxItemAeElementChildC in tbxItemAeElementChildB.children {
if let name = tbxItemAeElementChildC.attributes["name"] as? String {
if name == "Name" { // "Aeon Timeline TASC Container" {
let attribArray = tbxItemAeElementChildC.value!.componentsSeparatedByString(":")
if attribArray[0] == "Relationship" {
// now we know it's a relationship
tbxRelationshipString = tbxItemAeElementChildC.value!
foundARelationship = true
break
} // if
} // if
} // if
} // for
} // if
} //if
if foundARelationship {
var strings = assembleRelationshipStrings()
//search the strings
// if different, add the new one
}
} //else