dataschema-xml-min.js revision b9436848b51ee2b4f04b9217e74172c5a05ce276
YUI.add("dataschema-xml",function(C){var B=C.Lang,A={toString:function(){return"DataSchema.XML";},apply:function(F,G){var D=G,E={results:[],meta:{}};if(B.isObject(D)&&F){E=A._parseResults(F,D,E);E=A._parseMeta(F.metaFields,D,E);}else{E.error=true;}return E;},_getLocationValue:function(K,H){var F=K.locator||K.key||K,E=H.ownerDocument||H,D,G,I=null;try{if(!B.isUndefined(E.evaluate)){D=E.evaluate(F,H,E.createNSResolver(!H.ownerDocument?H.documentElement:H.ownerDocument.documentElement),0,null);while(G=D.iterateNext()){I=G.textContent;}}else{E.setProperty("SelectionLanguage","XPath");D=H.selectNodes(F)[0];I=D.value||D.text||null;}return C.DataSchema.Base.parse(I,K);}catch(J){}},_parseMeta:function(H,E,G){if(B.isObject(H)){var F,D=E.ownerDocument||E;for(F in H){if(H.hasOwnProperty(F)){G.meta[F]=A._getLocationValue(H[F],D);}}}return G;},_parseResults:function(F,M,G){if(F.resultsLocator&&B.isArray(F.resultsFields)){var E=M.getElementsByTagName(F.resultsLocator),K=F.resultsFields,J=[],D,L,N,I,H;if(E.length){for(I=E.length-1;I>=0;I--){N={};D=E[I];for(H=K.length-1;H>=0;H--){L=K[H];N[L.key||L]=A._getLocationValue(L,D);}J[I]=N;}G.results=J;}else{G.error=new Error(this.toString()+" Result nodes retrieval failure");}}return G;}};C.DataSchema.XML=C.mix(A,C.DataSchema.Base);},"@VERSION@",{requires:["dataschema-base"]});