Comparison

teal-src/util/datamapper.tl @ 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 11469:087d710ed520
comparison
equal deleted inserted replaced
11467:88792dd2bee9 11468:348b191cd850
321 end 321 end
322 end 322 end
323 return out; 323 return out;
324 324
325 elseif schema.type == "array" then 325 elseif schema.type == "array" then
326 local proptype, value_where, name, namespace = unpack_propschema(schema.items, current_name, current_ns) 326 local proptype, value_where, name, namespace, prefix, single_attribute = unpack_propschema(schema.items, current_name, current_ns)
327 -- TODO , prefix, single_attribute 327 for _, item in ipairs(t as { string }) do
328 if proptype == "string" then 328 unparse_property(out, item, proptype, schema.items, value_where, name, namespace, current_ns, prefix, single_attribute)
329 for _, item in ipairs(t as { string }) do
330 if value_where == "in_text_tag" then
331 out:text_tag(name, item, { xmlns = namespace });
332 else
333 error "NYI"
334 end
335 end
336 else
337 error "NYI"
338 end 329 end
339 return out; 330 return out;
340 end 331 end
341 end 332 end
342 333