From: miker Date: Tue, 2 Aug 2005 19:58:09 +0000 (+0000) Subject: fixing bare "array" inside fieldmapper objects X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=65086ed675c9f9e7ce2e5aa40b6e16cd5e9f2cd0;p=opensrf%2Fbjwebb.git fixing bare "array" inside fieldmapper objects git-svn-id: svn://svn.open-ils.org/OpenSRF/trunk@448 9efc2488-bf62-4759-914b-345cdb29e865 --- diff --git a/src/gateway/fieldmapper-c-xml-out.pl b/src/gateway/fieldmapper-c-xml-out.pl index fc9e563..7f7ef3e 100755 --- a/src/gateway/fieldmapper-c-xml-out.pl +++ b/src/gateway/fieldmapper-c-xml-out.pl @@ -78,7 +78,7 @@ void _rest_xml_output(growing_buffer* buf, object* obj, char * fm_class, int fm_ int i; - if(fm_class ) { + if(fm_class) { tag = _lookup_fm_field(fm_class,fm_index); } else { tag = strdup("datum"); @@ -109,13 +109,20 @@ void _rest_xml_output(growing_buffer* buf, object* obj, char * fm_class, int fm_ else if (obj->is_array) { - if (!obj->classname) + if(!fm_class) buffer_add(buf,""); + else + buffer_fadd(buf,"<%s>",tag); + for( i = 0; i!= obj->size; i++ ) { _rest_xml_output(buf, obj->get_index(obj,i), obj->classname, i); } - if (!obj->classname) - buffer_add(buf,""); + + if(!fm_class) + buffer_add(buf,""); + else + buffer_fadd(buf,"",tag); + } else if (obj->is_hash) { buffer_add(buf,""); object_iterator* itr = new_iterator(obj);