equal
deleted
inserted
replaced
124 i = i + 1 |
124 i = i + 1 |
125 local v = a[i] |
125 local v = a[i] |
126 if v then return v; end |
126 if v then return v; end |
127 end, self, i; |
127 end, self, i; |
128 end |
128 end |
|
129 |
|
130 function stanza_mt:matched_children(name, xmlns) |
|
131 xmlns = xmlns or self.attr.xmlns; |
|
132 local tags = self.tags; |
|
133 local start_i, max_i = 1, #tags; |
|
134 return function () |
|
135 for i=start_i,max_i do |
|
136 v = tags[i]; |
|
137 if (not name or v.name == name) |
|
138 and (not xmlns or xmlns == v.attr.xmlns) then |
|
139 start_i = i+1; |
|
140 return v; |
|
141 end |
|
142 end |
|
143 end, tags, i; |
|
144 end |
|
145 |
129 function stanza_mt:childtags() |
146 function stanza_mt:childtags() |
130 local i = 0; |
147 local i = 0; |
131 return function (a) |
148 return function (a) |
132 i = i + 1 |
149 i = i + 1 |
133 local v = self.tags[i] |
150 local v = self.tags[i] |