Software / code / prosody
Comparison
util/datamapper.lua @ 11468:348b191cd850
util.datamapper: Complete array building support
| author | Kim Alvefur <zash@zash.se> |
|---|---|
| date | Sat, 20 Mar 2021 21:29:51 +0100 |
| parent | 11467:88792dd2bee9 |
| child | 11470:5ebad952ebf7 |
comparison
equal
deleted
inserted
replaced
| 11467:88792dd2bee9 | 11468:348b191cd850 |
|---|---|
| 288 end | 288 end |
| 289 end | 289 end |
| 290 return out | 290 return out |
| 291 | 291 |
| 292 elseif schema.type == "array" then | 292 elseif schema.type == "array" then |
| 293 local proptype, value_where, name, namespace = unpack_propschema(schema.items, current_name, current_ns) | 293 local proptype, value_where, name, namespace, prefix, single_attribute = unpack_propschema(schema.items, current_name, current_ns) |
| 294 | 294 for _, item in ipairs(t) do |
| 295 if proptype == "string" then | 295 unparse_property(out, item, proptype, schema.items, value_where, name, namespace, current_ns, prefix, single_attribute) |
| 296 for _, item in ipairs(t) do | |
| 297 if value_where == "in_text_tag" then | |
| 298 out:text_tag(name, item, {xmlns = namespace}); | |
| 299 else | |
| 300 error("NYI") | |
| 301 end | |
| 302 end | |
| 303 else | |
| 304 error("NYI") | |
| 305 end | 296 end |
| 306 return out | 297 return out |
| 307 end | 298 end |
| 308 end | 299 end |
| 309 | 300 |