1/** 2 * @namespace WPGMZA 3 * @module XMLCacheConverter 4 * @requires WPGMZA 5 */ 6jQuery(function($) { 7 8 WPGMZA.XMLCacheConverter = function() 9 { 10 11 } 12 13 WPGMZA.XMLCacheConverter.prototype.convert = function(xml) 14 { 15 var markers = []; 16 var remap = { 17 "marker_id": "id", 18 "linkd": "link" 19 }; 20 21 $(xml).find("marker").each(function(index, el) { 22 23 var data = {}; 24 25 $(el).children().each(function(j, child) { 26 27 var key = child.nodeName; 28 29 if(remap[key]) 30 key = remap[key]; 31 32 if(child.hasAttribute("data-json")) 33 data[key] = JSON.parse($(child).text()); 34 else 35 data[key] = $(child).text(); 36 37 }); 38 39 markers.push(data); 40 41 }); 42 43 return markers; 44 } 45 46});
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.