def PutPositions::set(id,opts,xml)
doc = XML::Smart::string(xml)
content = {}
newkeys = []
doc.find("/*/*").map do |ele|
val = { 'position' => ele.qname.name }
val['passthrough'] = ele.attributes['passthrough'] if ele.attributes['passthrough']
content[ele.text] ||= []
content[ele.text] << val
newkeys << ele.qname.name
end
oldkeys = CPEE::Persistence::extract_set(id,opts,'positions').to_h.keys
del = oldkeys - newkeys
del.each do |key|
val = { 'position' => key }
content['unmark'] ||= []
content['unmark'] << val
end
CPEE::Persistence::set_item(id,opts,'position',content)
end