# File 'lib/soap/encodingstyle/soapHandler.rb', line 33defencode_data(generator,ns,data,parent)attrs=encode_attrs(generator,ns,data,parent)ifparent&&parent.is_a?(SOAPArray)&&parent.positionattrs[ns.name(AttrPositionName)]="[#{parent.position.join(',')}]"endname=generator.encode_name(ns,data,attrs)casedatawhenSOAPReferenceattrs['href']=data.refidstrgenerator.encode_tag(name,attrs)whenSOAPExternalReferencedata.referredattrs['href']=data.refidstrgenerator.encode_tag(name,attrs)whenSOAPRawStringgenerator.encode_tag(name,attrs)generator.encode_rawstring(data.to_s)whenXSD::XSDStringgenerator.encode_tag(name,attrs)generator.encode_string(@charset?XSD::Charset.encoding_to_xml(data.to_s,@charset):data.to_s)whenXSD::XSDAnySimpleTypegenerator.encode_tag(name,attrs)generator.encode_string(data.to_s)whenSOAPStructgenerator.encode_tag(name,attrs)data.eachdo|key,value|generator.encode_child(ns,value,data)endwhenSOAPArraygenerator.encode_tag(name,attrs)data.traversedo|child,*rank|data.position=data.sparse?rank:nilgenerator.encode_child(ns,child,data)endelseraiseEncodingStyleError.new("unknown object:#{data} in this encodingStyle")endend