kendo.data.xml.min.js 6.58 KB
/** 
 * Kendo UI v2016.1.112 (http://www.telerik.com/kendo-ui)                                                                                                                                               
 * Copyright 2016 Telerik AD. All rights reserved.                                                                                                                                                      
 *                                                                                                                                                                                                      
 * Kendo UI commercial licenses may be obtained at                                                                                                                                                      
 * http://www.telerik.com/purchase/license-agreement/kendo-ui-complete                                                                                                                                  
 * If you do not own a commercial license, this file shall be governed by the trial license terms.                                                                                                      
                                                                                                                                                                                                       
                                                                                                                                                                                                       
                                                                                                                                                                                                       
                                                                                                                                                                                                       
                                                                                                                                                                                                       
                                                                                                                                                                                                       
                                                                                                                                                                                                       
                                                                                                                                                                                                       
                                                                                                                                                                                                       
                                                                                                                                                                                                       
                                                                                                                                                                                                       
                                                                                                                                                                                                       
                                                                                                                                                                                                       
                                                                                                                                                                                                       
                                                                                                                                                                                                       

*/
!function(e,define){define("kendo.data.xml.min",["kendo.core.min"],e)}(function(){return function(e,t){var n=window.kendo,r=e.isArray,i=e.isPlainObject,o=e.map,a=e.each,f=e.extend,d=n.getter,l=n.Class,u=l.extend({init:function(t){var d,l,u,s,c=this,p=t.total,m=t.model,h=t.parse,x=t.errors,g=t.serialize,y=t.data;m&&(i(m)&&(d=t.modelBase||n.data.Model,m.fields&&a(m.fields,function(t,n){i(n)&&n.field?e.isFunction(n.field)||(n=f(n,{field:c.getter(n.field)})):n={field:c.getter(n)},m.fields[t]=n}),l=m.id,l&&(u={},u[c.xpathToMember(l,!0)]={field:c.getter(l)},m.fields=f(u,m.fields),m.id=c.xpathToMember(l)),m=d.define(m)),c.model=m),p&&("string"==typeof p?(p=c.getter(p),c.total=function(e){return parseInt(p(e),10)}):"function"==typeof p&&(c.total=p)),x&&("string"==typeof x?(x=c.getter(x),c.errors=function(e){return x(e)||null}):"function"==typeof x&&(c.errors=x)),y&&("string"==typeof y?(y=c.xpathToMember(y),c.data=function(e){var t,n=c.evaluate(e,y);return n=r(n)?n:[n],c.model&&m.fields?(t=new c.model,o(n,function(e){if(e){var n,r={};for(n in m.fields)r[n]=t._parse(n,m.fields[n].field(e));return r}})):n}):"function"==typeof y&&(c.data=y)),"function"==typeof h&&(s=c.parse,c.parse=function(e){var t=h.call(c,e);return s.call(c,t)}),"function"==typeof g&&(c.serialize=g)},total:function(e){return this.data(e).length},errors:function(e){return e?e.errors:null},serialize:function(e){return e},parseDOM:function(e){var n,i,o,a,f,d,l,u={},s=e.attributes,c=s.length;for(l=0;c>l;l++)d=s[l],u["@"+d.nodeName]=d.nodeValue;for(i=e.firstChild;i;i=i.nextSibling)o=i.nodeType,3===o||4===o?u["#text"]=i.nodeValue:1===o&&(n=this.parseDOM(i),a=i.nodeName,f=u[a],r(f)?f.push(n):f=f!==t?[f,n]:n,u[a]=f);return u},evaluate:function(e,t){for(var n,i,o,a,f,d=t.split(".");n=d.shift();)if(e=e[n],r(e)){for(i=[],t=d.join("."),f=0,o=e.length;o>f;f++)a=this.evaluate(e[f],t),a=r(a)?a:[a],i.push.apply(i,a);return i}return e},parse:function(t){var n,r,i={};return n=t.documentElement||e.parseXML(t).documentElement,r=this.parseDOM(n),i[n.nodeName]=r,i},xpathToMember:function(e,t){return e?(e=e.replace(/^\//,"").replace(/\//g,"."),e.indexOf("@")>=0?e.replace(/\.?(@.*)/,t?"$1":'["$1"]'):e.indexOf("text()")>=0?e.replace(/(\.?text\(\))/,t?"#text":'["#text"]'):e):""},getter:function(e){return d(this.xpathToMember(e),!0)}});e.extend(!0,n.data,{XmlDataReader:u,readers:{xml:u}})}(window.kendo.jQuery),window.kendo},"function"==typeof define&&define.amd?define:function(e,t,n){(n||t)()});
//# sourceMappingURL=kendo.data.xml.min.js.map