Преглед изворни кода

HPCC-8052 nested ChildDatasets not showing up in ECL Playground generated results

Adding missing dojox.xml files.

Signed-off-by: Gordon Smith <gordon.smith@lexisnexis.com>
Gordon Smith пре 12 година
родитељ
комит
1ba22886d7

+ 319 - 0
esp/files/dojox/xml/DomParser.js

@@ -0,0 +1,319 @@
+//>>built
+define("dojox/xml/DomParser",["dojo/_base/kernel","dojo/_base/array"],function(_1){
+_1.getObject("xml",true,dojox);
+dojox.xml.DomParser=new (function(){
+var _2={ELEMENT:1,ATTRIBUTE:2,TEXT:3,CDATA_SECTION:4,PROCESSING_INSTRUCTION:7,COMMENT:8,DOCUMENT:9};
+var _3=/<([^>\/\s+]*)([^>]*)>([^<]*)/g;
+var _4=/([^=]*)=(("([^"]*)")|('([^']*)'))/g;
+var _5=/<!ENTITY\s+([^"]*)\s+"([^"]*)">/g;
+var _6=/<!\[CDATA\[([\u0001-\uFFFF]*?)\]\]>/g;
+var _7=/<!--([\u0001-\uFFFF]*?)-->/g;
+var _8=/^\s+|\s+$/g;
+var _9=/\s+/g;
+var _a=/\&gt;/g;
+var _b=/\&lt;/g;
+var _c=/\&quot;/g;
+var _d=/\&apos;/g;
+var _e=/\&amp;/g;
+var _f="_def_";
+function _10(){
+return new (function(){
+var all={};
+this.nodeType=_2.DOCUMENT;
+this.nodeName="#document";
+this.namespaces={};
+this._nsPaths={};
+this.childNodes=[];
+this.documentElement=null;
+this._add=function(obj){
+if(typeof (obj.id)!="undefined"){
+all[obj.id]=obj;
+}
+};
+this._remove=function(id){
+if(all[id]){
+delete all[id];
+}
+};
+this.byId=this.getElementById=function(id){
+return all[id];
+};
+this.byName=this.getElementsByTagName=_11;
+this.byNameNS=this.getElementsByTagNameNS=_12;
+this.childrenByName=_13;
+this.childrenByNameNS=_14;
+})();
+};
+function _11(_15){
+function _16(_17,_18,arr){
+_1.forEach(_17.childNodes,function(c){
+if(c.nodeType==_2.ELEMENT){
+if(_18=="*"){
+arr.push(c);
+}else{
+if(c.nodeName==_18){
+arr.push(c);
+}
+}
+_16(c,_18,arr);
+}
+});
+};
+var a=[];
+_16(this,_15,a);
+return a;
+};
+function _12(_19,ns){
+function _1a(_1b,_1c,ns,arr){
+_1.forEach(_1b.childNodes,function(c){
+if(c.nodeType==_2.ELEMENT){
+if(_1c=="*"&&c.ownerDocument._nsPaths[ns]==c.namespace){
+arr.push(c);
+}else{
+if(c.localName==_1c&&c.ownerDocument._nsPaths[ns]==c.namespace){
+arr.push(c);
+}
+}
+_1a(c,_1c,ns,arr);
+}
+});
+};
+if(!ns){
+ns=_f;
+}
+var a=[];
+_1a(this,_19,ns,a);
+return a;
+};
+function _13(_1d){
+var a=[];
+_1.forEach(this.childNodes,function(c){
+if(c.nodeType==_2.ELEMENT){
+if(_1d=="*"){
+a.push(c);
+}else{
+if(c.nodeName==_1d){
+a.push(c);
+}
+}
+}
+});
+return a;
+};
+function _14(_1e,ns){
+var a=[];
+_1.forEach(this.childNodes,function(c){
+if(c.nodeType==_2.ELEMENT){
+if(_1e=="*"&&c.ownerDocument._nsPaths[ns]==c.namespace){
+a.push(c);
+}else{
+if(c.localName==_1e&&c.ownerDocument._nsPaths[ns]==c.namespace){
+a.push(c);
+}
+}
+}
+});
+return a;
+};
+function _1f(v){
+return {nodeType:_2.TEXT,nodeName:"#text",nodeValue:v.replace(_9," ").replace(_a,">").replace(_b,"<").replace(_d,"'").replace(_c,"\"").replace(_e,"&")};
+};
+function _20(_21){
+for(var i=0;i<this.attributes.length;i++){
+if(this.attributes[i].nodeName==_21){
+return this.attributes[i].nodeValue;
+}
+}
+return null;
+};
+function _22(_23,ns){
+for(var i=0;i<this.attributes.length;i++){
+if(this.ownerDocument._nsPaths[ns]==this.attributes[i].namespace&&this.attributes[i].localName==_23){
+return this.attributes[i].nodeValue;
+}
+}
+return null;
+};
+function _24(_25,val){
+var old=null;
+for(var i=0;i<this.attributes.length;i++){
+if(this.attributes[i].nodeName==_25){
+old=this.attributes[i].nodeValue;
+this.attributes[i].nodeValue=val;
+break;
+}
+}
+if(_25=="id"){
+if(old!=null){
+this.ownerDocument._remove(old);
+}
+this.ownerDocument._add(this);
+}
+};
+function _26(_27,val,ns){
+for(var i=0;i<this.attributes.length;i++){
+if(this.ownerDocument._nsPaths[ns]==this.attributes[i].namespace&&this.attributes[i].localName==_27){
+this.attributes[i].nodeValue=val;
+return;
+}
+}
+};
+function _28(){
+var p=this.parentNode;
+if(p){
+for(var i=0;i<p.childNodes.length;i++){
+if(p.childNodes[i]==this&&i>0){
+return p.childNodes[i-1];
+}
+}
+}
+return null;
+};
+function _29(){
+var p=this.parentNode;
+if(p){
+for(var i=0;i<p.childNodes.length;i++){
+if(p.childNodes[i]==this&&(i+1)<p.childNodes.length){
+return p.childNodes[i+1];
+}
+}
+}
+return null;
+};
+this.parse=function(str){
+var _2a=_10();
+if(str==null){
+return _2a;
+}
+if(str.length==0){
+return _2a;
+}
+if(str.indexOf("<!ENTITY")>0){
+var _2b,eRe=[];
+if(_5.test(str)){
+_5.lastIndex=0;
+while((_2b=_5.exec(str))!=null){
+eRe.push({entity:"&"+_2b[1].replace(_8,"")+";",expression:_2b[2]});
+}
+for(var i=0;i<eRe.length;i++){
+str=str.replace(new RegExp(eRe[i].entity,"g"),eRe[i].expression);
+}
+}
+}
+var _2c=[],_2d;
+while((_2d=_6.exec(str))!=null){
+_2c.push(_2d[1]);
+}
+for(var i=0;i<_2c.length;i++){
+str=str.replace(_2c[i],i);
+}
+var _2e=[],_2f;
+while((_2f=_7.exec(str))!=null){
+_2e.push(_2f[1]);
+}
+for(i=0;i<_2e.length;i++){
+str=str.replace(_2e[i],i);
+}
+var res,obj=_2a;
+while((res=_3.exec(str))!=null){
+if(res[2].charAt(0)=="/"&&res[2].replace(_8,"").length>1){
+if(obj.parentNode){
+obj=obj.parentNode;
+}
+var _30=(res[3]||"").replace(_8,"");
+if(_30.length>0){
+obj.childNodes.push(_1f(_30));
+}
+}else{
+if(res[1].length>0){
+if(res[1].charAt(0)=="?"){
+var _31=res[1].substr(1);
+var _32=res[2].substr(0,res[2].length-2);
+obj.childNodes.push({nodeType:_2.PROCESSING_INSTRUCTION,nodeName:_31,nodeValue:_32});
+}else{
+if(res[1].charAt(0)=="!"){
+if(res[1].indexOf("![CDATA[")==0){
+var val=parseInt(res[1].replace("![CDATA[","").replace("]]",""));
+obj.childNodes.push({nodeType:_2.CDATA_SECTION,nodeName:"#cdata-section",nodeValue:_2c[val]});
+}else{
+if(res[1].substr(0,3)=="!--"){
+var val=parseInt(res[1].replace("!--","").replace("--",""));
+obj.childNodes.push({nodeType:_2.COMMENT,nodeName:"#comment",nodeValue:_2e[val]});
+}
+}
+}else{
+var _31=res[1].replace(_8,"");
+var o={nodeType:_2.ELEMENT,nodeName:_31,localName:_31,namespace:_f,ownerDocument:_2a,attributes:[],parentNode:null,childNodes:[]};
+if(_31.indexOf(":")>-1){
+var t=_31.split(":");
+o.namespace=t[0];
+o.localName=t[1];
+}
+o.byName=o.getElementsByTagName=_11;
+o.byNameNS=o.getElementsByTagNameNS=_12;
+o.childrenByName=_13;
+o.childrenByNameNS=_14;
+o.getAttribute=_20;
+o.getAttributeNS=_22;
+o.setAttribute=_24;
+o.setAttributeNS=_26;
+o.previous=o.previousSibling=_28;
+o.next=o.nextSibling=_29;
+var _33;
+while((_33=_4.exec(res[2]))!=null){
+if(_33.length>0){
+var _31=_33[1].replace(_8,"");
+var val=(_33[4]||_33[6]||"").replace(_9," ").replace(_a,">").replace(_b,"<").replace(_d,"'").replace(_c,"\"").replace(_e,"&");
+if(_31.indexOf("xmlns")==0){
+if(_31.indexOf(":")>0){
+var ns=_31.split(":");
+_2a.namespaces[ns[1]]=val;
+_2a._nsPaths[val]=ns[1];
+}else{
+_2a.namespaces[_f]=val;
+_2a._nsPaths[val]=_f;
+}
+}else{
+var ln=_31;
+var ns=_f;
+if(_31.indexOf(":")>0){
+var t=_31.split(":");
+ln=t[1];
+ns=t[0];
+}
+o.attributes.push({nodeType:_2.ATTRIBUTE,nodeName:_31,localName:ln,namespace:ns,nodeValue:val});
+if(ln=="id"){
+o.id=val;
+}
+}
+}
+}
+_2a._add(o);
+if(obj){
+obj.childNodes.push(o);
+o.parentNode=obj;
+if(res[2].charAt(res[2].length-1)!="/"){
+obj=o;
+}
+}
+var _30=res[3];
+if(_30.length>0){
+obj.childNodes.push(_1f(_30));
+}
+}
+}
+}
+}
+}
+for(var i=0;i<_2a.childNodes.length;i++){
+var e=_2a.childNodes[i];
+if(e.nodeType==_2.ELEMENT){
+_2a.documentElement=e;
+break;
+}
+}
+return _2a;
+};
+})();
+return dojox.xml.DomParser;
+});

+ 40 - 0
esp/files/dojox/xml/README

@@ -0,0 +1,40 @@
+-------------------------------------------------------------------------------
+DojoX XML Utilities
+-------------------------------------------------------------------------------
+Version 0.1
+Release date: 05/30/2007	
+-------------------------------------------------------------------------------
+Project state:
+experimental
+-------------------------------------------------------------------------------
+Credits 
+	Tom Trenka (ttrenka@gmail.com): DomParser
+	
+-------------------------------------------------------------------------------
+Project description
+
+The goal of DojoX XML Utilities is provide differing XML utilities for use
+in various places.  Currently this includes a native JS DomParser, but will
+most likely be expanded to include things as dealing with x-browser forks
+(like the Sarissa project), various DOM utilites, and more.
+-------------------------------------------------------------------------------
+Dependencies:
+
+DojoX XML relies only on the Dojo Base package system.
+-------------------------------------------------------------------------------
+Documentation
+
+None at the time of writing.  The only object is dojox.xml.DomParser (a singleton),
+which has one method: parse:
+
+dojox.xml.DomParser.parse(xmlString)
+-------------------------------------------------------------------------------
+Installation instructions
+
+Grab the following from the Dojo SVN Repository:
+http://svn.dojotoolkit.org/var/src/dojo/dojox/trunk/xml/*
+
+Install into the following directory structure:
+/dojox/xml/
+
+...which should be at the same level as your Dojo checkout.

+ 8 - 0
esp/files/dojox/xml/Script.js

@@ -0,0 +1,8 @@
+//>>built
+define("dojox/xml/Script",["dojo/_base/kernel","dojo/_base/declare","dojo/parser","./widgetParser"],function(_1,_2,_3){
+dojo.getObject("xml",true,dojox);
+_1("dojox.xml.Script",null,{constructor:function(_4,_5){
+_2.instantiate(_3._processScript(_5));
+}});
+return dojox.xml.Script;
+});

+ 131 - 0
esp/files/dojox/xml/parser.js

@@ -0,0 +1,131 @@
+//>>built
+define("dojox/xml/parser",["dojo/_base/kernel","dojo/_base/lang","dojo/_base/array","dojo/_base/window","dojo/_base/sniff"],function(_1){
+_1.getObject("xml.parser",true,dojox);
+dojox.xml.parser.parse=function(_2,_3){
+var _4=_1.doc;
+var _5;
+_3=_3||"text/xml";
+if(_2&&_1.trim(_2)&&"DOMParser" in _1.global){
+var _6=new DOMParser();
+_5=_6.parseFromString(_2,_3);
+var de=_5.documentElement;
+var _7="http://www.mozilla.org/newlayout/xml/parsererror.xml";
+if(de.nodeName=="parsererror"&&de.namespaceURI==_7){
+var _8=de.getElementsByTagNameNS(_7,"sourcetext")[0];
+if(_8){
+_8=_8.firstChild.data;
+}
+throw new Error("Error parsing text "+de.firstChild.data+" \n"+_8);
+}
+return _5;
+}else{
+if("ActiveXObject" in _1.global){
+var ms=function(n){
+return "MSXML"+n+".DOMDocument";
+};
+var dp=["Microsoft.XMLDOM",ms(6),ms(4),ms(3),ms(2)];
+_1.some(dp,function(p){
+try{
+_5=new ActiveXObject(p);
+}
+catch(e){
+return false;
+}
+return true;
+});
+if(_2&&_5){
+_5.async=false;
+_5.loadXML(_2);
+var pe=_5.parseError;
+if(pe.errorCode!==0){
+throw new Error("Line: "+pe.line+"\n"+"Col: "+pe.linepos+"\n"+"Reason: "+pe.reason+"\n"+"Error Code: "+pe.errorCode+"\n"+"Source: "+pe.srcText);
+}
+}
+if(_5){
+return _5;
+}
+}else{
+if(_4.implementation&&_4.implementation.createDocument){
+if(_2&&_1.trim(_2)&&_4.createElement){
+var _9=_4.createElement("xml");
+_9.innerHTML=_2;
+var _a=_4.implementation.createDocument("foo","",null);
+_1.forEach(_9.childNodes,function(_b){
+_a.importNode(_b,true);
+});
+return _a;
+}else{
+return _4.implementation.createDocument("","",null);
+}
+}
+}
+}
+return null;
+};
+dojox.xml.parser.textContent=function(_c,_d){
+if(arguments.length>1){
+var _e=_c.ownerDocument||_1.doc;
+dojox.xml.parser.replaceChildren(_c,_e.createTextNode(_d));
+return _d;
+}else{
+if(_c.textContent!==undefined){
+return _c.textContent;
+}
+var _f="";
+if(_c){
+_1.forEach(_c.childNodes,function(_10){
+switch(_10.nodeType){
+case 1:
+case 5:
+_f+=dojox.xml.parser.textContent(_10);
+break;
+case 3:
+case 2:
+case 4:
+_f+=_10.nodeValue;
+}
+});
+}
+return _f;
+}
+};
+dojox.xml.parser.replaceChildren=function(_11,_12){
+var _13=[];
+if(_1.isIE){
+_1.forEach(_11.childNodes,function(_14){
+_13.push(_14);
+});
+}
+dojox.xml.parser.removeChildren(_11);
+_1.forEach(_13,_1.destroy);
+if(!_1.isArray(_12)){
+_11.appendChild(_12);
+}else{
+_1.forEach(_12,function(_15){
+_11.appendChild(_15);
+});
+}
+};
+dojox.xml.parser.removeChildren=function(_16){
+var _17=_16.childNodes.length;
+while(_16.hasChildNodes()){
+_16.removeChild(_16.firstChild);
+}
+return _17;
+};
+dojox.xml.parser.innerXML=function(_18){
+if(_18.innerXML){
+return _18.innerXML;
+}else{
+if(_18.xml){
+return _18.xml;
+}else{
+if(typeof XMLSerializer!="undefined"){
+return (new XMLSerializer()).serializeToString(_18);
+}
+}
+}
+return null;
+};
+return dojox.xml.parser;
+});

+ 61 - 0
esp/files/dojox/xml/widgetParser.js

@@ -0,0 +1,61 @@
+//>>built
+define("dojox/xml/widgetParser",["dojo/_base/lang","dojo/_base/window","dojo/_base/sniff","dojo/query","dojo/parser","dojox/xml/parser"],function(_1,_2,_3,_4,_5,_6){
+var _7=lang.getObject("dojox.xml",true);
+xXml.widgetParser=new function(){
+var d=_1;
+this.parseNode=function(_8){
+var _9=[];
+d.query("script[type='text/xml']",_8).forEach(function(_a){
+_9.push.apply(_9,this._processScript(_a));
+},this).orphan();
+return d.parser.instantiate(_9);
+};
+this._processScript=function(_b){
+var _c=_b.src?d._getText(_b.src):_b.innerHTML||_b.firstChild.nodeValue;
+var _d=this.toHTML(dojox.xml.parser.parse(_c).firstChild);
+var _e=d.query("[dojoType]",_d);
+_4(">",_d).place(_b,"before");
+_b.parentNode.removeChild(_b);
+return _e;
+};
+this.toHTML=function(_f){
+var _10;
+var _11=_f.nodeName;
+var dd=_2.doc;
+var _12=_f.nodeType;
+if(_12>=3){
+return dd.createTextNode((_12==3||_12==4)?_f.nodeValue:"");
+}
+var _13=_f.localName||_11.split(":").pop();
+var _14=_f.namespaceURI||(_f.getNamespaceUri?_f.getNamespaceUri():"");
+if(_14=="html"){
+_10=dd.createElement(_13);
+}else{
+var _15=_14+"."+_13;
+_10=_10||dd.createElement((_15=="dijit.form.ComboBox")?"select":"div");
+_10.setAttribute("dojoType",_15);
+}
+d.forEach(_f.attributes,function(_16){
+var _17=_16.name||_16.nodeName;
+var _18=_16.value||_16.nodeValue;
+if(_17.indexOf("xmlns")!=0){
+if(_3("ie")&&_17=="style"){
+_10.style.setAttribute("cssText",_18);
+}else{
+_10.setAttribute(_17,_18);
+}
+}
+});
+d.forEach(_f.childNodes,function(cn){
+var _19=this.toHTML(cn);
+if(_13=="script"){
+_10.text+=_19.nodeValue;
+}else{
+_10.appendChild(_19);
+}
+},this);
+return _10;
+};
+}();
+return _7.widgetParser;
+});