/*
	Licensed to the Apache Software Foundation (ASF) under one
#  or more contributor license agreements.  See the NOTICE file
#  distributed with this work for additional information
#  regarding copyright ownership.  The ASF licenses this file
#  to you under the Apache License, Version 2.0 (the
#  "License"); you may not use this file except in compliance
#  with the License.  You may obtain a copy of the License at
 
		http://www.apache.org/licenses/LICENSE-2.0
 
	Unless required by applicable law or agreed to in writing, software
	distributed under the License is distributed on an "AS IS" BASIS,
	WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
	See the License for the specific language governing permissions and
	limitations under the License.
	
	Portions copyright (c) 2004-2007, The Dojo Foundation
	All Rights Reserved.

	Dojo portions are licensed under the Academic Free License version 
	2.1 or above OR the modified BSD license. For more information on 
	Dojo licensing, see:

		http://dojotoolkit.org/community/licensing.shtml

	These portions constitute a compiled version of Dojo, built for deploy- 
	ment and not for development. To get an editable version, please visit:

		http://dojotoolkit.org

	for documentation and information on getting the source.	
	
 	Portions copyright 2005 Google Inc.
 	All Rights Reserved

 	Google portions are licensed under the BSD license, for
 	which see:
		http://www.opensource.org/licenses/bsd-license.php 		
 
 */

/*
	This is a compiled version of XAP, built for deployment.
*/if(typeof dojo=="undefined"){
var dj_global=this;
var dj_currentContext=this;
function dj_undef(_1,_2){
return (typeof (_2||dj_currentContext)[_1]=="undefined");
}
if(dj_undef("djConfig",this)){
var djConfig={};
}
if(dj_undef("dojo",this)){
var dojo={};
}
dojo.global=function(){
return dj_currentContext;
};
dojo.locale=djConfig.locale;
dojo.version={major:0,minor:0,patch:0,flag:"dev",revision:Number("$Rev: 6824 $".match(/[0-9]+/)[0]),toString:function(){
with(dojo.version){
return major+"."+minor+"."+patch+flag+" ("+revision+")";
}
}};
dojo.evalProp=function(_3,_4,_5){
if((!_4)||(!_3)){
return undefined;
}
if(!dj_undef(_3,_4)){
return _4[_3];
}
return (_5?(_4[_3]={}):undefined);
};
dojo.parseObjPath=function(_6,_7,_8){
var _9=(_7||dojo.global());
var _a=_6.split(".");
var _b=_a.pop();
for(var i=0,l=_a.length;i<l&&_9;i++){
_9=dojo.evalProp(_a[i],_9,_8);
}
return {obj:_9,prop:_b};
};
dojo.evalObjPath=function(_d,_e){
if(typeof _d!="string"){
return dojo.global();
}
if(_d.indexOf(".")==-1){
return dojo.evalProp(_d,dojo.global(),_e);
}
var _f=dojo.parseObjPath(_d,dojo.global(),_e);
if(_f){
return dojo.evalProp(_f.prop,_f.obj,_e);
}
return null;
};
dojo.errorToString=function(_10){
if(!dj_undef("message",_10)){
return _10.message;
}else{
if(!dj_undef("description",_10)){
return _10.description;
}else{
return _10;
}
}
};
dojo.raise=function(_11,_12){
if(_12){
_11=_11+": "+dojo.errorToString(_12);
}else{
_11=dojo.errorToString(_11);
}
try{
if(djConfig.isDebug){
dojo.hostenv.println("FATAL exception raised: "+_11);
}
}
catch(e){
}
throw _12||Error(_11);
};
dojo.debug=function(){
};
dojo.debugShallow=function(obj){
};
dojo.profile={start:function(){
},end:function(){
},stop:function(){
},dump:function(){
}};
function dj_eval(_14){
return dj_global.eval?dj_global.eval(_14):eval(_14);
}
dojo.unimplemented=function(_15,_16){
var _17="'"+_15+"' not implemented";
if(_16!=null){
_17+=" "+_16;
}
dojo.raise(_17);
};
dojo.deprecated=function(_18,_19,_1a){
var _1b="DEPRECATED: "+_18;
if(_19){
_1b+=" "+_19;
}
if(_1a){
_1b+=" -- will be removed in version: "+_1a;
}
dojo.debug(_1b);
};
dojo.render=(function(){
function vscaffold(_1c,_1d){
var tmp={capable:false,support:{builtin:false,plugin:false},prefixes:_1c};
for(var i=0;i<_1d.length;i++){
tmp[_1d[i]]=false;
}
return tmp;
}
return {name:"",ver:dojo.version,os:{win:false,linux:false,osx:false},html:vscaffold(["html"],["ie","opera","khtml","safari","moz"]),svg:vscaffold(["svg"],["corel","adobe","batik"]),vml:vscaffold(["vml"],["ie"]),swf:vscaffold(["Swf","Flash","Mm"],["mm"]),swt:vscaffold(["Swt"],["ibm"])};
})();
dojo.hostenv=(function(){
var _20={isDebug:false,allowQueryConfig:false,baseScriptUri:"",baseRelativePath:"",libraryScriptUri:"",iePreventClobber:false,ieClobberMinimal:true,preventBackButtonFix:true,delayMozLoadingFix:false,searchIds:[],parseWidgets:true};
if(typeof djConfig=="undefined"){
djConfig=_20;
}else{
for(var _21 in _20){
if(typeof djConfig[_21]=="undefined"){
djConfig[_21]=_20[_21];
}
}
}
return {name_:"(unset)",version_:"(unset)",getName:function(){
return this.name_;
},getVersion:function(){
return this.version_;
},getText:function(uri){
dojo.unimplemented("getText","uri="+uri);
}};
})();
dojo.hostenv.getBaseScriptUri=function(){
if(djConfig.baseScriptUri.length){
return djConfig.baseScriptUri;
}
var uri=new String(djConfig.libraryScriptUri||djConfig.baseRelativePath);
if(!uri){
dojo.raise("Nothing returned by getLibraryScriptUri(): "+uri);
}
var _24=uri.lastIndexOf("/");
djConfig.baseScriptUri=djConfig.baseRelativePath;
return djConfig.baseScriptUri;
};
(function(){
var _25={pkgFileName:"__package__",loading_modules_:{},loaded_modules_:{},addedToLoadingCount:[],removedFromLoadingCount:[],inFlightCount:0,modulePrefixes_:{dojo:{name:"dojo",value:"src"}},setModulePrefix:function(_26,_27){
this.modulePrefixes_[_26]={name:_26,value:_27};
},moduleHasPrefix:function(_28){
var mp=this.modulePrefixes_;
return Boolean(mp[_28]&&mp[_28].value);
},getModulePrefix:function(_2a){
if(this.moduleHasPrefix(_2a)){
return this.modulePrefixes_[_2a].value;
}
return _2a;
},getTextStack:[],loadUriStack:[],loadedUris:[],post_load_:false,modulesLoadedListeners:[],unloadListeners:[],loadNotifying:false};
for(var _2b in _25){
dojo.hostenv[_2b]=_25[_2b];
}
})();
dojo.hostenv.loadPath=function(_2c,_2d,cb){
var uri;
if(_2c.charAt(0)=="/"||_2c.match(/^\w+:/)){
uri=_2c;
}else{
uri=this.getBaseScriptUri()+_2c;
}
if(djConfig.cacheBust&&dojo.render.html.capable){
uri+="?"+String(djConfig.cacheBust).replace(/\W+/g,"");
}
try{
return !_2d?this.loadUri(uri,cb):this.loadUriAndCheck(uri,_2d,cb);
}
catch(e){
dojo.debug(e);
return false;
}
};
dojo.hostenv.loadUri=function(uri,cb){
if(this.loadedUris[uri]){
return true;
}
var _32=this.getText(uri,null,true);
if(!_32){
return false;
}
this.loadedUris[uri]=true;
if(cb){
_32="("+_32+")";
}
var _33=dj_eval(_32);
if(cb){
cb(_33);
}
return true;
};
dojo.hostenv.loadUriAndCheck=function(uri,_35,cb){
var ok=true;
try{
ok=this.loadUri(uri,cb);
}
catch(e){
dojo.debug("failed loading ",uri," with error: ",e);
}
return Boolean(ok&&this.findModule(_35,false));
};
dojo.loaded=function(){
};
dojo.unloaded=function(){
};
dojo.hostenv.loaded=function(){
this.loadNotifying=true;
this.post_load_=true;
var mll=this.modulesLoadedListeners;
for(var x=0;x<mll.length;x++){
mll[x]();
}
this.modulesLoadedListeners=[];
this.loadNotifying=false;
dojo.loaded();
};
dojo.hostenv.unloaded=function(){
var mll=this.unloadListeners;
while(mll.length){
(mll.pop())();
}
dojo.unloaded();
};
dojo.addOnLoad=function(obj,_3c){
var dh=dojo.hostenv;
if(arguments.length==1){
dh.modulesLoadedListeners.push(obj);
}else{
if(arguments.length>1){
dh.modulesLoadedListeners.push(function(){
obj[_3c]();
});
}
}
if(dh.post_load_&&dh.inFlightCount==0&&!dh.loadNotifying){
dh.callLoaded();
}
};
dojo.addOnUnload=function(obj,_3f){
var dh=dojo.hostenv;
if(arguments.length==1){
dh.unloadListeners.push(obj);
}else{
if(arguments.length>1){
dh.unloadListeners.push(function(){
obj[_3f]();
});
}
}
};
dojo.hostenv.modulesLoaded=function(){
if(this.post_load_){
return;
}
if(this.loadUriStack.length==0&&this.getTextStack.length==0){
if(this.inFlightCount>0){
dojo.debug("files still in flight!");
return;
}
dojo.hostenv.callLoaded();
}
};
dojo.hostenv.callLoaded=function(){
if(typeof setTimeout=="object"){
setTimeout("dojo.hostenv.loaded();",0);
}else{
dojo.hostenv.loaded();
}
};
dojo.hostenv.getModuleSymbols=function(_41){
var _42=_41.split(".");
for(var i=_42.length;i>0;i--){
var _44=_42.slice(0,i).join(".");
if((i==1)&&!this.moduleHasPrefix(_44)){
_42[0]="../"+_42[0];
}else{
var _45=this.getModulePrefix(_44);
if(_45!=_44){
_42.splice(0,i,_45);
break;
}
}
}
return _42;
};
dojo.hostenv._global_omit_module_check=false;
dojo.hostenv.loadModule=function(_46,_47,_48){
if(!_46){
return;
}
_48=this._global_omit_module_check||_48;
var _49=this.findModule(_46,false);
if(_49){
return _49;
}
if(dj_undef(_46,this.loading_modules_)){
this.addedToLoadingCount.push(_46);
}
this.loading_modules_[_46]=1;
var _4a=_46.replace(/\./g,"/")+".js";
var _4b=_46.split(".");
var _4c=this.getModuleSymbols(_46);
var _4d=((_4c[0].charAt(0)!="/")&&!_4c[0].match(/^\w+:/));
var _4e=_4c[_4c.length-1];
var ok;
if(_4e=="*"){
_46=_4b.slice(0,-1).join(".");
while(_4c.length){
_4c.pop();
_4c.push(this.pkgFileName);
_4a=_4c.join("/")+".js";
if(_4d&&_4a.charAt(0)=="/"){
_4a=_4a.slice(1);
}
ok=this.loadPath(_4a,!_48?_46:null);
if(ok){
break;
}
_4c.pop();
}
}else{
_4a=_4c.join("/")+".js";
_46=_4b.join(".");
var _50=!_48?_46:null;
ok=this.loadPath(_4a,_50);
if(!ok&&!_47){
_4c.pop();
while(_4c.length){
_4a=_4c.join("/")+".js";
ok=this.loadPath(_4a,_50);
if(ok){
break;
}
_4c.pop();
_4a=_4c.join("/")+"/"+this.pkgFileName+".js";
if(_4d&&_4a.charAt(0)=="/"){
_4a=_4a.slice(1);
}
ok=this.loadPath(_4a,_50);
if(ok){
break;
}
}
}
if(!ok&&!_48){
dojo.raise("Could not load '"+_46+"'; last tried '"+_4a+"'");
}
}
if(!_48&&!this["isXDomain"]){
_49=this.findModule(_46,false);
if(!_49){
dojo.raise("symbol '"+_46+"' is not defined after loading '"+_4a+"'");
}
}
return _49;
};
dojo.hostenv.startPackage=function(_51){
var _52=String(_51);
var _53=_52;
var _54=_51.split(/\./);
if(_54[_54.length-1]=="*"){
_54.pop();
_53=_54.join(".");
}
var _55=dojo.evalObjPath(_53,true);
this.loaded_modules_[_52]=_55;
this.loaded_modules_[_53]=_55;
return _55;
};
dojo.hostenv.findModule=function(_56,_57){
var lmn=String(_56);
if(this.loaded_modules_[lmn]){
return this.loaded_modules_[lmn];
}
if(_57){
dojo.raise("no loaded module named '"+_56+"'");
}
return null;
};
dojo.kwCompoundRequire=function(_59){
var _5a=_59["common"]||[];
var _5b=_59[dojo.hostenv.name_]?_5a.concat(_59[dojo.hostenv.name_]||[]):_5a.concat(_59["default"]||[]);
for(var x=0;x<_5b.length;x++){
var _5d=_5b[x];
if(_5d.constructor==Array){
dojo.hostenv.loadModule.apply(dojo.hostenv,_5d);
}else{
dojo.hostenv.loadModule(_5d);
}
}
};
dojo.require=function(_5e){
dojo.hostenv.loadModule.apply(dojo.hostenv,arguments);
};
dojo.requireIf=function(_5f,_60){
var _61=arguments[0];
if((_61===true)||(_61=="common")||(_61&&dojo.render[_61].capable)){
var _62=[];
for(var i=1;i<arguments.length;i++){
_62.push(arguments[i]);
}
dojo.require.apply(dojo,_62);
}
};
dojo.requireAfterIf=dojo.requireIf;
dojo.provide=function(_64){
return dojo.hostenv.startPackage.apply(dojo.hostenv,arguments);
};
dojo.registerModulePath=function(_65,_66){
return dojo.hostenv.setModulePrefix(_65,_66);
};
dojo.setModulePrefix=function(_67,_68){
dojo.deprecated("dojo.setModulePrefix(\""+_67+"\", \""+_68+"\")","replaced by dojo.registerModulePath","0.5");
return dojo.registerModulePath(_67,_68);
};
dojo.exists=function(obj,_6a){
var p=_6a.split(".");
for(var i=0;i<p.length;i++){
if(!obj[p[i]]){
return false;
}
obj=obj[p[i]];
}
return true;
};
dojo.hostenv.normalizeLocale=function(_6d){
var _6e=_6d?_6d.toLowerCase():dojo.locale;
if(_6e=="root"){
_6e="ROOT";
}
return _6e;
};
dojo.hostenv.searchLocalePath=function(_6f,_70,_71){
_6f=dojo.hostenv.normalizeLocale(_6f);
var _72=_6f.split("-");
var _73=[];
for(var i=_72.length;i>0;i--){
_73.push(_72.slice(0,i).join("-"));
}
_73.push(false);
if(_70){
_73.reverse();
}
for(var j=_73.length-1;j>=0;j--){
var loc=_73[j]||"ROOT";
var _77=_71(loc);
if(_77){
break;
}
}
};
dojo.hostenv.localesGenerated;
dojo.hostenv.registerNlsPrefix=function(){
dojo.registerModulePath("nls","nls");
};
dojo.hostenv.preloadLocalizations=function(){
if(dojo.hostenv.localesGenerated){
dojo.hostenv.registerNlsPrefix();
function preload(_78){
_78=dojo.hostenv.normalizeLocale(_78);
dojo.hostenv.searchLocalePath(_78,true,function(loc){
for(var i=0;i<dojo.hostenv.localesGenerated.length;i++){
if(dojo.hostenv.localesGenerated[i]==loc){
dojo["require"]("nls.dojo_"+loc);
return true;
}
}
return false;
});
}
preload();
var _7b=djConfig.extraLocale||[];
for(var i=0;i<_7b.length;i++){
preload(_7b[i]);
}
}
dojo.hostenv.preloadLocalizations=function(){
};
};
dojo.requireLocalization=function(_7d,_7e,_7f,_80){
dojo.hostenv.preloadLocalizations();
var _81=dojo.hostenv.normalizeLocale(_7f);
var _82=[_7d,"nls",_7e].join(".");
var _83="";
if(_80){
var _84=_80.split(",");
for(var i=0;i<_84.length;i++){
if(_81.indexOf(_84[i])==0){
if(_84[i].length>_83.length){
_83=_84[i];
}
}
}
if(!_83){
_83="ROOT";
}
}
var _86=_80?_83:_81;
var _87=dojo.hostenv.findModule(_82);
var _88=null;
if(_87){
if(djConfig.localizationComplete&&_87._built){
return;
}
var _89=_86.replace("-","_");
var _8a=_82+"."+_89;
_88=dojo.hostenv.findModule(_8a);
}
if(!_88){
_87=dojo.hostenv.startPackage(_82);
var _8b=dojo.hostenv.getModuleSymbols(_7d);
var _8c=_8b.concat("nls").join("/");
var _8d;
dojo.hostenv.searchLocalePath(_86,_80,function(loc){
var _8f=loc.replace("-","_");
var _90=_82+"."+_8f;
var _91=false;
if(!dojo.hostenv.findModule(_90)){
dojo.hostenv.startPackage(_90);
var _92=[_8c];
if(loc!="ROOT"){
_92.push(loc);
}
_92.push(_7e);
var _93=_92.join("/")+".js";
_91=dojo.hostenv.loadPath(_93,null,function(_94){
var _95=function(){
};
_95.prototype=_8d;
_87[_8f]=new _95();
for(var j in _94){
_87[_8f][j]=_94[j];
}
});
}else{
_91=true;
}
if(_91&&_87[_8f]){
_8d=_87[_8f];
}else{
_87[_8f]=_8d;
}
if(_80){
return true;
}
});
}
if(_80&&_81!=_83){
_87[_81.replace("-","_")]=_87[_83.replace("-","_")];
}
};
(function(){
var _97=djConfig.extraLocale;
if(_97){
if(!_97 instanceof Array){
_97=[_97];
}
var req=dojo.requireLocalization;
dojo.requireLocalization=function(m,b,_9b,_9c){
req(m,b,_9b,_9c);
if(_9b){
return;
}
for(var i=0;i<_97.length;i++){
req(m,b,_97[i],_9c);
}
};
}
})();
}
if(typeof window!="undefined"){
(function(){
if(djConfig.allowQueryConfig){
var _9e=document.location.toString();
var _9f=_9e.split("?",2);
if(_9f.length>1){
var _a0=_9f[1];
var _a1=_a0.split("&");
for(var x in _a1){
var sp=_a1[x].split("=");
if((sp[0].length>9)&&(sp[0].substr(0,9)=="djConfig.")){
var opt=sp[0].substr(9);
try{
djConfig[opt]=eval(sp[1]);
}
catch(e){
djConfig[opt]=sp[1];
}
}
}
}
}
if(((djConfig["baseScriptUri"]=="")||(djConfig["baseRelativePath"]==""))&&(document&&document.getElementsByTagName)){
var _a5=document.getElementsByTagName("script");
var _a6=/(__package__|dojo|bootstrap1)\.js([\?\.]|$)/i;
for(var i=0;i<_a5.length;i++){
var src=_a5[i].getAttribute("src");
if(!src){
continue;
}
var m=src.match(_a6);
if(m){
var _aa=src.substring(0,m.index);
if(src.indexOf("bootstrap1")>-1){
_aa+="../";
}
if(!this["djConfig"]){
djConfig={};
}
if(djConfig["baseScriptUri"]==""){
djConfig["baseScriptUri"]=_aa;
}
if(djConfig["baseRelativePath"]==""){
djConfig["baseRelativePath"]=_aa;
}
break;
}
}
}
var dr=dojo.render;
var drh=dojo.render.html;
var drs=dojo.render.svg;
var dua=(drh.UA=navigator.userAgent);
var dav=(drh.AV=navigator.appVersion);
var t=true;
var f=false;
drh.capable=t;
drh.support.builtin=t;
dr.ver=parseFloat(drh.AV);
dr.os.mac=dav.indexOf("Macintosh")>=0;
dr.os.win=dav.indexOf("Windows")>=0;
dr.os.linux=dav.indexOf("X11")>=0;
drh.opera=dua.indexOf("Opera")>=0;
drh.khtml=(dav.indexOf("Konqueror")>=0)||(dav.indexOf("Safari")>=0);
drh.safari=dav.indexOf("Safari")>=0;
var _b2=dua.indexOf("Gecko");
drh.mozilla=drh.moz=(_b2>=0)&&(!drh.khtml);
if(drh.mozilla){
drh.geckoVersion=dua.substring(_b2+6,_b2+14);
}
drh.ie=(document.all)&&(!drh.opera);
drh.ie50=drh.ie&&dav.indexOf("MSIE 5.0")>=0;
drh.ie55=drh.ie&&dav.indexOf("MSIE 5.5")>=0;
drh.ie60=drh.ie&&dav.indexOf("MSIE 6.0")>=0;
drh.ie70=drh.ie&&dav.indexOf("MSIE 7.0")>=0;
var cm=document["compatMode"];
drh.quirks=(cm=="BackCompat")||(cm=="QuirksMode")||drh.ie55||drh.ie50;
dojo.locale=dojo.locale||(drh.ie?navigator.userLanguage:navigator.language).toLowerCase();
dr.vml.capable=drh.ie;
drs.capable=f;
drs.support.plugin=f;
drs.support.builtin=f;
var _b4=window["document"];
var tdi=_b4["implementation"];
if((tdi)&&(tdi["hasFeature"])&&(tdi.hasFeature("org.w3c.dom.svg","1.0"))){
drs.capable=t;
drs.support.builtin=t;
drs.support.plugin=f;
}
if(drh.safari){
var tmp=dua.split("AppleWebKit/")[1];
var ver=parseFloat(tmp.split(" ")[0]);
if(ver>=420){
drs.capable=t;
drs.support.builtin=t;
drs.support.plugin=f;
}
}else{
}
})();
dojo.hostenv.startPackage("dojo.hostenv");
dojo.render.name=dojo.hostenv.name_="browser";
dojo.hostenv.searchIds=[];
dojo.hostenv._XMLHTTP_PROGIDS=["Msxml2.XMLHTTP","Microsoft.XMLHTTP","Msxml2.XMLHTTP.4.0"];
dojo.hostenv.getXmlhttpObject=function(){
var _b8=null;
var _b9=null;
try{
_b8=new XMLHttpRequest();
}
catch(e){
}
if(!_b8){
for(var i=0;i<3;++i){
var _bb=dojo.hostenv._XMLHTTP_PROGIDS[i];
try{
_b8=new ActiveXObject(_bb);
}
catch(e){
_b9=e;
}
if(_b8){
dojo.hostenv._XMLHTTP_PROGIDS=[_bb];
break;
}
}
}
if(!_b8){
return dojo.raise("XMLHTTP not available",_b9);
}
return _b8;
};
dojo.hostenv._blockAsync=false;
dojo.hostenv.getText=function(uri,_bd,_be){
if(!_bd){
this._blockAsync=true;
}
var _bf=this.getXmlhttpObject();
function isDocumentOk(_c0){
var _c1=_c0["status"];
return Boolean((!_c1)||((200<=_c1)&&(300>_c1))||(_c1==304));
}
if(_bd){
var _c2=this,timer=null,gbl=dojo.global();
var xhr=dojo.evalObjPath("dojo.io.XMLHTTPTransport");
_bf.onreadystatechange=function(){
if(timer){
gbl.clearTimeout(timer);
timer=null;
}
if(_c2._blockAsync||(xhr&&xhr._blockAsync)){
timer=gbl.setTimeout(function(){
_bf.onreadystatechange.apply(this);
},10);
}else{
if(4==_bf.readyState){
if(isDocumentOk(_bf)){
_bd(_bf.responseText);
}
}
}
};
}
_bf.open("GET",uri,_bd?true:false);
try{
_bf.send(null);
if(_bd){
return null;
}
if(!isDocumentOk(_bf)){
var err=Error("Unable to load "+uri+" status:"+_bf.status);
err.status=_bf.status;
err.responseText=_bf.responseText;
throw err;
}
}
catch(e){
this._blockAsync=false;
if((_be)&&(!_bd)){
return null;
}else{
throw e;
}
}
this._blockAsync=false;
return _bf.responseText;
};
dojo.hostenv.defaultDebugContainerId="dojoDebug";
dojo.hostenv._println_buffer=[];
dojo.hostenv._println_safe=false;
dojo.hostenv.println=function(_c5){
if(!dojo.hostenv._println_safe){
dojo.hostenv._println_buffer.push(_c5);
}else{
try{
var _c6=document.getElementById(djConfig.debugContainerId?djConfig.debugContainerId:dojo.hostenv.defaultDebugContainerId);
if(!_c6){
_c6=dojo.body();
}
var div=document.createElement("div");
div.appendChild(document.createTextNode(_c5));
_c6.appendChild(div);
}
catch(e){
try{
document.write("<div>"+_c5+"</div>");
}
catch(e2){
window.status=_c5;
}
}
}
};
dojo.addOnLoad(function(){
dojo.hostenv._println_safe=true;
while(dojo.hostenv._println_buffer.length>0){
dojo.hostenv.println(dojo.hostenv._println_buffer.shift());
}
});
function dj_addNodeEvtHdlr(_c8,_c9,fp){
var _cb=_c8["on"+_c9]||function(){
};
_c8["on"+_c9]=function(){
fp.apply(_c8,arguments);
_cb.apply(_c8,arguments);
};
return true;
}
function dj_load_init(e){
var _cd=(e&&e.type)?e.type.toLowerCase():"load";
if(arguments.callee.initialized||(_cd!="domcontentloaded"&&_cd!="load")){
return;
}
arguments.callee.initialized=true;
if(typeof (_timer)!="undefined"){
clearInterval(_timer);
delete _timer;
}
var _ce=function(){
if(dojo.render.html.ie){
dojo.hostenv.makeWidgets();
}
};
if(dojo.hostenv.inFlightCount==0){
_ce();
dojo.hostenv.modulesLoaded();
}else{
dojo.hostenv.modulesLoadedListeners.unshift(_ce);
}
}
if(document.addEventListener){
if(dojo.render.html.opera||(dojo.render.html.moz&&!djConfig.delayMozLoadingFix)){
document.addEventListener("DOMContentLoaded",dj_load_init,null);
}
window.addEventListener("load",dj_load_init,null);
}
if(dojo.render.html.ie&&dojo.render.os.win){
document.attachEvent("onreadystatechange",function(e){
if(document.readyState=="complete"){
dj_load_init();
}
});
}
if(/(WebKit|khtml)/i.test(navigator.userAgent)){
var _timer=setInterval(function(){
if(/loaded|complete/.test(document.readyState)){
dj_load_init();
}
},10);
}
if(dojo.render.html.ie){
dj_addNodeEvtHdlr(window,"beforeunload",function(){
dojo.hostenv._unloading=true;
window.setTimeout(function(){
dojo.hostenv._unloading=false;
},0);
});
}
dj_addNodeEvtHdlr(window,"unload",function(){
dojo.hostenv.unloaded();
if((!dojo.render.html.ie)||(dojo.render.html.ie&&dojo.hostenv._unloading)){
dojo.hostenv.unloaded();
}
});
dojo.hostenv.makeWidgets=function(){
var _d0=[];
if(djConfig.searchIds&&djConfig.searchIds.length>0){
_d0=_d0.concat(djConfig.searchIds);
}
if(dojo.hostenv.searchIds&&dojo.hostenv.searchIds.length>0){
_d0=_d0.concat(dojo.hostenv.searchIds);
}
if((djConfig.parseWidgets)||(_d0.length>0)){
if(dojo.evalObjPath("dojo.widget.Parse")){
var _d1=new dojo.xml.Parse();
if(_d0.length>0){
for(var x=0;x<_d0.length;x++){
var _d3=document.getElementById(_d0[x]);
if(!_d3){
continue;
}
var _d4=_d1.parseElement(_d3,null,true);
dojo.widget.getParser().createComponents(_d4);
}
}else{
if(djConfig.parseWidgets){
var _d4=_d1.parseElement(dojo.body(),null,true);
dojo.widget.getParser().createComponents(_d4);
}
}
}
}
};
dojo.addOnLoad(function(){
if(!dojo.render.html.ie){
dojo.hostenv.makeWidgets();
}
});
try{
if(dojo.render.html.ie){
document.namespaces.add("v","urn:schemas-microsoft-com:vml");
document.createStyleSheet().addRule("v\\:*","behavior:url(#default#VML)");
}
}
catch(e){
}
dojo.hostenv.writeIncludes=function(){
};
if(!dj_undef("document",this)){
dj_currentDocument=this.document;
}
dojo.doc=function(){
return dj_currentDocument;
};
dojo.body=function(){
return dojo.doc().body||dojo.doc().getElementsByTagName("body")[0];
};
dojo.byId=function(id,doc){
if((id)&&((typeof id=="string")||(id instanceof String))){
if(!doc){
doc=dj_currentDocument;
}
var ele=doc.getElementById(id);
if(ele&&(ele.id!=id)&&doc.all){
ele=null;
eles=doc.all[id];
if(eles){
if(eles.length){
for(var i=0;i<eles.length;i++){
if(eles[i].id==id){
ele=eles[i];
break;
}
}
}else{
ele=eles;
}
}
}
return ele;
}
return id;
};
dojo.setContext=function(_d9,_da){
dj_currentContext=_d9;
dj_currentDocument=_da;
};
dojo._fireCallback=function(_db,_dc,_dd){
if((_dc)&&((typeof _db=="string")||(_db instanceof String))){
_db=_dc[_db];
}
return (_dc?_db.apply(_dc,_dd||[]):_db());
};
dojo.withGlobal=function(_de,_df,_e0,_e1){
var _e2;
var _e3=dj_currentContext;
var _e4=dj_currentDocument;
try{
dojo.setContext(_de,_de.document);
_e2=dojo._fireCallback(_df,_e0,_e1);
}
finally{
dojo.setContext(_e3,_e4);
}
return _e2;
};
dojo.withDoc=function(_e5,_e6,_e7,_e8){
var _e9;
var _ea=dj_currentDocument;
try{
dj_currentDocument=_e5;
_e9=dojo._fireCallback(_e6,_e7,_e8);
}
finally{
dj_currentDocument=_ea;
}
return _e9;
};
}
(function(){
if(typeof dj_usingBootstrap!="undefined"){
return;
}
var _eb=false;
var _ec=false;
var _ed=false;
if((typeof this["load"]=="function")&&((typeof this["Packages"]=="function")||(typeof this["Packages"]=="object"))){
_eb=true;
}else{
if(typeof this["load"]=="function"){
_ec=true;
}else{
if(window.widget){
_ed=true;
}
}
}
var _ee=[];
if((this["djConfig"])&&((djConfig["isDebug"])||(djConfig["debugAtAllCosts"]))){
_ee.push("debug.js");
}
if((this["djConfig"])&&(djConfig["debugAtAllCosts"])&&(!_eb)&&(!_ed)){
_ee.push("browser_debug.js");
}
var _ef=djConfig["baseScriptUri"];
if((this["djConfig"])&&(djConfig["baseLoaderUri"])){
_ef=djConfig["baseLoaderUri"];
}
for(var x=0;x<_ee.length;x++){
var _f1=_ef+"src/"+_ee[x];
if(_eb||_ec){
load(_f1);
}else{
try{
document.write("<scr"+"ipt type='text/javascript' src='"+_f1+"'></scr"+"ipt>");
}
catch(e){
var _f2=document.createElement("script");
_f2.src=_f1;
document.getElementsByTagName("head")[0].appendChild(_f2);
}
}
}
})();
dojo.provide("xap.util.Utils");
xap.util.Utils=function(){
};
xap.util.Utils.oneLevelObjectDump=function(obj,_f4,_f5){
var s="";
var _f7=new Array(0);
var _f8=new Array(0);
if(typeof obj!="object"){
s="<not an object>";
}else{
for(var _f9 in obj){
if(!_f4&&typeof obj[_f9]=="function"){
continue;
}
var _fa=""+obj[_f9];
if(_f5&&(_fa.length>_f5)){
var _fb="";
var _fc=_fa.length-_f5;
_fb+=_fa.substring(0,Math.round((2*_f5)/3));
_fb+="...<"+_fc+" characters>...";
_fb+=_fa.substring(_fa.length-Math.round((1*_f5)/3));
_fa=_fb;
}
if(typeof obj[_f9]=="function"){
_f8.push(""+_f9+":"+_fa);
}else{
_f7.push(""+_f9+":"+_fa);
}
}
_f7=_f7.sort();
_f8=_f8.sort();
var _fd=Array.concat(_f7,_f8);
s=_fd.join("\n");
}
return s;
};
xap.util.Utils.interrogate=function(obj,_ff,_100){
var s=xap.util.Utils.oneLevelObjectDump(obj,_ff,_100);
prompt("",s.replace(/[\r\n]/g,"^"));
};
Xap={};
Xap._override=function(){
if(dojo.hostenv.getBaseScriptUri!=Xap.dojo_hostenv_getBaseScriptUri){
dojo.hostenv.getBaseScriptUri=Xap.dojo_hostenv_getBaseScriptUri;
}
if(dojo.uri.dojoUri!=Xap.dojo_uri_dojoUri){
dojo.uri.dojoUri=Xap.dojo_uri_dojoUri;
}
};
Xap.createApplication=function(_102){
Xap._override();
Xap.require("xap.application.Application");
var _103=new xap.application.Application(_102);
_103.create();
return _103;
};
Xap.createEmbeddedApplications=function(){
Xap._override();
Xap.require("xap.html.HtmlConnector");
xap.html.HtmlConnector.scanPage();
xap.html.HtmlConnector.createEmbeddedApplications();
return window.xapApplications;
};
if(!djConfig){
djConfig={baseRelativePath:"../../src/dojo/"};
}else{
if(!djConfig.baseRelativePath){
djConfig.baseRelativePath="../../src/dojo/";
}
}
dojo.hostenv.setModulePrefix("dojo",djConfig.baseRelativePath+"src");
dojo.hostenv.setModulePrefix("xap",djConfig.baseRelativePath+"../xap");
dojo.hostenv.setModulePrefix("google",djConfig.baseRelativePath+"../google");
Xap.dojo_hostenv_getBaseScriptUri=function(){
return "";
};
Xap.dojo_uri_dojoUri=function(uri){
return new dojo.uri.Uri(djConfig.baseRelativePath,uri);
};
Xap.ourDebugLoadClasses={};
Xap.kwCompoundRequire=function(){
dojo.kwCompoundRequire.apply(dojo,arguments);
};
Xap.provide=function(){
return dojo.provide.apply(dojo,arguments);
};
Xap.require=function(){
var _105=false;
dojo.require("xap.util.Debug");
var _106=Xap.getDebuggingObject();
var _107=arguments[0];
var _108=(_107.search(xap.util.Debug.anyAsteriskRegexp)==-1);
var _109=(Xap.ourDebugLoadClasses[_107])?true:false;
var _10a=_106&&_108&&(xap.util.Debug._debugAll||(xap.util.Debug._debugLoad&&xap.util.Debug._debuggables[_107]));
try{
dojo.require.apply(dojo,arguments);
if(_10a&&!_109){
if(!_106.preloaded){
_106.addDebuggables(_107);
}else{
_106.loadDebuggables([_107]);
}
Xap.ourDebugLoadClasses[_107]=true;
}
_105=true;
}
catch(ee){
_105=false;
}
return _105;
};
Xap.resolveConstructor=function(_10b){
var _10c;
var _10d=dj_global;
if(typeof _10d[_10b]!=="undefined"){
_10c=_10d[_10b];
}else{
var arr=_10b.split(".");
for(var kk=0;kk<arr.length-1;++kk){
_10d=_10d[arr[kk]];
if(typeof _10d=="undefined"){
return _10d;
}
}
_10c=_10d[arr[arr.length-1]];
}
return _10c;
};
Xap.setupClassAsSubclassOf=function(_110,_111){
var _112=Xap.resolveConstructor(_110);
var _113=Xap.resolveConstructor(_111);
_112.prototype=new _113();
_112.superclass=_113.prototype;
_112.prototype.constructor=_112;
_112.prototype.toString=function(){
return "[a "+_110+"]";
};
_112.toString=function(){
return "[class "+_110+"]";
};
};
Xap.getDebuggingObject=function(){
if(!xap.util.Debug){
return null;
}else{
return xap.util.Debug;
}
};
if(typeof OpenAjax!="undefined"){
OpenAjax.registerLibrary("xap","http://openxal.org/xap","0.3");
OpenAjax.registerGlobals("xap",["xap","google","Xap"]);
OpenAjax.addOnLoad(Xap.createEmbeddedApplications,null,"application");
}
Xap.provide("xap.util.Debug");
xap.util.Debug._sourceRootDir="../../src";
xap.util.Debug.setSourceRootDir=function(_114){
xap.util.Debug._sourceRootDir=_114;
};
xap.util.Debug.addDebuggables=function(dbs){
if(!xap.util.Debug._debuggables){
xap.util.Debug._debuggables=new Object();
}
if(typeof dbs=="string"){
return xap.util.Debug.addDebuggables([dbs]);
}
for(var ii=0;ii<dbs.length;++ii){
xap.util.Debug._debuggables[dbs[ii]]=true;
}
};
xap.util.Debug.preloadDebuggables=function(){
xap.util.Debug.loadDebuggables.apply(arguments);
xap.util.Debug.preloaded=true;
};
xap.util.Debug.loadDebuggables=function(){
if(arguments.length==0){
if(xap.util.Debug._debuggables){
xap.util.Debug.loadDebuggables(xap.util.Debug._debuggables);
}
return;
}else{
if((typeof arguments[0])!="string"){
for(var nom in arguments[0]){
xap.util.Debug._loadDebuggable(nom);
}
}else{
xap.util.Debug._loadDebuggable(arg[0]);
}
}
};
xap.util.Debug.trailingSlashRegexp=/^.*\/$/;
xap.util.Debug.allFullstopsRegexp=/\./g;
xap.util.Debug.anyAsteriskRegexp=/\*/g;
xap.util.Debug.initialDoubleDots=new RegExp("^../");
xap.util.Debug.ourModuleMap={};
for(var prefx in dojo.hostenv.modulePrefixes_){
var path=dojo.hostenv.modulePrefixes_[prefx].value;
path=path.replace(/^\.\./,"");
path=xap.util.Debug._sourceRootDir+path;
xap.util.Debug.ourModuleMap[prefx]=path;
}
xap.util.Debug._loadDebuggable=function(str){
var path=str.replace(xap.util.Debug.allFullstopsRegexp,"/");
var arr=str.split(".");
if(arr[0]=="dojo"){
if(typeof eval(str)!="undefined"){
return;
}
}
var _11b=xap.util.Debug.ourModuleMap[arr[0]];
if(!_11b){
return;
}
arr.shift();
path=_11b+"/"+arr.join("/")+".js";
xap.util.Debug.importFile(path);
};
xap.util.Debug.setDebug=function(tf){
xap.util.Debug._debugLoad=tf;
};
xap.util.Debug.HEAD=null;
xap.util.Debug.importFile=function(path){
if(xap.util.Debug.s_pathCache==null){
xap.util.Debug.s_pathCache=new Object();
}
if(xap.util.Debug.s_pathCache[path]){
return;
}
xap.util.Debug.s_pathCache[path]=true;
if(!document.body){
var _11e="<script language=\"JavaScript\" "+"type=\"text/javascript\" src=\""+path+"\"></script>";
document.write(_11e);
}else{
var _11f=document.createElement("SCRIPT");
_11f.type="text/javascript";
_11f.language="JavaScript";
_11f.src=path;
if(!xap.util.Debug.HEAD){
xap.util.Debug.HEAD=document.getElementsByTagName("head")[0];
}
xap.util.Debug.HEAD.appendChild(_11f);
}
};
xap.util.Debug.s_pathCache=null;
xap.util.Debug.setDebugAll=function(tf){
xap.util.Debug._debugAll=true;
};
if(window.debug_config){
for(var key in window.debug_config){
xap.util.Debug[key]=window.debug_config[key];
}
if(xap.util.Debug._debugList){
xap.util.Debug._debugLoad=true;
xap.util.Debug.addDebuggables(xap.util.Debug._debugList);
}
}
dojo.provide("dojo.lang.common");
dojo.lang.inherits=function(_121,_122){
if(!dojo.lang.isFunction(_122)){
dojo.raise("dojo.inherits: superclass argument ["+_122+"] must be a function (subclass: ["+_121+"']");
}
_121.prototype=new _122();
_121.prototype.constructor=_121;
_121.superclass=_122.prototype;
_121["super"]=_122.prototype;
};
dojo.lang._mixin=function(obj,_124){
var tobj={};
for(var x in _124){
if((typeof tobj[x]=="undefined")||(tobj[x]!=_124[x])){
obj[x]=_124[x];
}
}
if(dojo.render.html.ie&&(typeof (_124["toString"])=="function")&&(_124["toString"]!=obj["toString"])&&(_124["toString"]!=tobj["toString"])){
obj.toString=_124.toString;
}
return obj;
};
dojo.lang.mixin=function(obj,_128){
for(var i=1,l=arguments.length;i<l;i++){
dojo.lang._mixin(obj,arguments[i]);
}
return obj;
};
dojo.lang.extend=function(_12a,_12b){
for(var i=1,l=arguments.length;i<l;i++){
dojo.lang._mixin(_12a.prototype,arguments[i]);
}
return _12a;
};
dojo.inherits=dojo.lang.inherits;
dojo.mixin=dojo.lang.mixin;
dojo.extend=dojo.lang.extend;
dojo.lang.find=function(_12d,_12e,_12f,_130){
if(!dojo.lang.isArrayLike(_12d)&&dojo.lang.isArrayLike(_12e)){
dojo.deprecated("dojo.lang.find(value, array)","use dojo.lang.find(array, value) instead","0.5");
var temp=_12d;
_12d=_12e;
_12e=temp;
}
var _132=dojo.lang.isString(_12d);
if(_132){
_12d=_12d.split("");
}
if(_130){
var step=-1;
var i=_12d.length-1;
var end=-1;
}else{
var step=1;
var i=0;
var end=_12d.length;
}
if(_12f){
while(i!=end){
if(_12d[i]===_12e){
return i;
}
i+=step;
}
}else{
while(i!=end){
if(_12d[i]==_12e){
return i;
}
i+=step;
}
}
return -1;
};
dojo.lang.indexOf=dojo.lang.find;
dojo.lang.findLast=function(_136,_137,_138){
return dojo.lang.find(_136,_137,_138,true);
};
dojo.lang.lastIndexOf=dojo.lang.findLast;
dojo.lang.inArray=function(_139,_13a){
return dojo.lang.find(_139,_13a)>-1;
};
dojo.lang.isObject=function(it){
if(typeof it=="undefined"){
return false;
}
return (typeof it=="object"||it===null||dojo.lang.isArray(it)||dojo.lang.isFunction(it));
};
dojo.lang.isArray=function(it){
return (it&&it instanceof Array||typeof it=="array");
};
dojo.lang.isArrayLike=function(it){
if((!it)||(dojo.lang.isUndefined(it))){
return false;
}
if(dojo.lang.isString(it)){
return false;
}
if(dojo.lang.isFunction(it)){
return false;
}
if(dojo.lang.isArray(it)){
return true;
}
if((it.tagName)&&(it.tagName.toLowerCase()=="form")){
return false;
}
if(dojo.lang.isNumber(it.length)&&isFinite(it.length)){
return true;
}
return false;
};
dojo.lang.isFunction=function(it){
return (it instanceof Function||typeof it=="function");
};
(function(){
if((dojo.render.html.capable)&&(dojo.render.html["safari"])){
dojo.lang.isFunction=function(it){
if((typeof (it)=="function")&&(it=="[object NodeList]")){
return false;
}
return (it instanceof Function||typeof it=="function");
};
}
})();
dojo.lang.isString=function(it){
return (typeof it=="string"||it instanceof String);
};
dojo.lang.isAlien=function(it){
if(!it){
return false;
}
return !dojo.lang.isFunction(it)&&/\{\s*\[native code\]\s*\}/.test(String(it));
};
dojo.lang.isBoolean=function(it){
return (it instanceof Boolean||typeof it=="boolean");
};
dojo.lang.isNumber=function(it){
return (it instanceof Number||typeof it=="number");
};
dojo.lang.isUndefined=function(it){
return ((typeof (it)=="undefined")&&(it==undefined));
};
dojo.provide("dojo.lang");
dojo.deprecated("dojo.lang","replaced by dojo.lang.common","0.5");
Xap.provide("xap.util.MessageFormat");
Xap.require("dojo.lang");
xap.util.MessageFormat=function(){
};
xap.util.MessageFormat.format=function(_145,args){
if(!_145){
return null;
}
if(!dojo.lang.isArray(args)){
args=[args];
}
for(var i=0;args&&i<args.length;i++){
var _148="\\{"+i+"\\}";
var _149=new RegExp(_148,"gm");
_145=_145.replace(_149,""+args[i]);
}
return _145;
};
Xap.provide("xap.util.Exception");
xap.util.Exception=function(_14a,_14b,_14c){
this._message=_14a;
this._cause=_14b;
this._location=_14c;
};
xap.util.Exception.prototype.getLocation=function(){
return this._location;
};
xap.util.Exception.prototype.getMessage=function(){
return this._message;
};
xap.util.Exception.prototype.getCause=function(){
return this._cause;
};
xap.util.Exception.prototype.toString=function(){
var buf="Message:"+this._message;
if(this._cause!=null){
buf+="\nCause:"+this._cause.toString();
}
return buf;
};
Xap.provide("xap.util.Hashtable");
Xap.require("xap.util.Exception");
xap.util.Hashtable=function(){
this._hashtable=new Object();
this._size=0;
};
xap.util.Hashtable.s_uniqueKey=0;
xap.util.Hashtable.prototype.clear=function(){
this._hashtable=new Object();
};
xap.util.Hashtable.prototype.containsKey=function(key){
if(key===null){
throw new xap.util.Exception("key cannot be null in xap.util.Hashtable.containsKey()");
}
key=this._computeKey(key);
return this._hashtable[key]!=null;
};
xap.util.Hashtable.prototype.containsValue=function(_14f){
if(_14f==null){
throw new xap.util.Exception("value cannot be null at xap.util.Hashtable.containsValue()");
}
for(var i in this._hashtable){
if(this._hashtable[i]==_14f){
return true;
}
}
return false;
};
xap.util.Hashtable.prototype.get=function(key){
if(key==null){
throw new xap.util.Exception("key cannot be null at xap.util.Hashtable.get()");
}
key=this._computeKey(key);
return this._hashtable[key];
};
xap.util.Hashtable.prototype.put=function(key,_153){
if(key==null){
throw new xap.util.Exception("key cannot be null at xap.util.Hashtable.put()");
}
if(_153==null){
throw new xap.util.Exception("value cannot be null at xap.util.Hashtable.put()");
}
key=this._computeKey(key);
if(this._hashtable[key]==null){
this._size++;
}
var o=this._hashtable[key];
this._hashtable[key]=_153;
return o;
};
xap.util.Hashtable.prototype.remove=function(key){
if(key==null){
throw new xap.util.Exception("key cannot be null at xap.util.Hashtable.remove()");
}
key=this._computeKey(key);
var rtn=this._hashtable[key];
delete (this._hashtable[key]);
if(rtn!=null){
this._size--;
}
return rtn;
};
xap.util.Hashtable.prototype.size=function(){
return this._size;
};
xap.util.Hashtable.prototype.toString=function(){
var _157="{";
for(var i in this._hashtable){
if(this._hashtable[i]!=null){
_157+=i+"=>"+this._hashtable[i]+"\n";
}
}
_157+="}";
return _157;
};
xap.util.Hashtable.prototype.keys=function(){
var keys=new Array(this.size());
var _15a=0;
for(var i in this._hashtable){
if(this._hashtable[i]!=null){
keys[_15a]=i;
_15a++;
}
}
return keys;
};
xap.util.Hashtable.prototype.values=function(){
var _15c=new Array(this.size());
var _15d=0;
for(var i in this._hashtable){
if(this._hashtable[i]!=null){
_15c[_15d]=this._hashtable[i];
_15d++;
}
}
return _15c;
};
xap.util.Hashtable.prototype._computeKey=function(x){
if(typeof (x)!="object"){
return x.toString();
}
if(x.constructor==Number||x.constructor==String){
return x.toString();
}
if(x._xapHashKey==null){
x._xapHashKey=xap.util.Hashtable.s_uniqueKey++;
}
return x._xapHashKey.toString();
};
Xap.provide("xap.util.ResourceDictionary");
Xap.require("xap.util.MessageFormat");
Xap.require("xap.util.Hashtable");
xap.util.ResourceDictionary=function(){
};
xap.util.ResourceDictionary.s_classnameToResourceObject=new xap.util.Hashtable();
xap.util.ResourceDictionary.s_log=null;
xap.util.ResourceDictionary.getMessage=function(_160,_161,args){
var _163="xap.log.Logger";
Xap.require(_163);
var _164=xap.util.ResourceDictionary.s_classnameToResourceObject.get(_161);
if(!_164){
try{
Xap.require(_161+"Res");
_164=eval("new "+_161+"Res();");
xap.util.ResourceDictionary.s_classnameToResourceObject.put(_161,_164);
}
catch(e){
if(!xap.util.ResourceDictionary.s_log){
xap.util.ResourceDictionary.s_log=xap.log.Logger.getLogger("xap.util.ResourceDictionary");
}
xap.util.ResourceDictionary.s_log.error("Exception getting message:"+"id="+_160+",classname="+_161+", args:"+args+", exception:"+e,e);
}
}
if(_164){
var _165=_164.messages[_160];
return xap.util.MessageFormat.format(_165,args);
}
return "MsgId:"+_160+",class:"+_161+",args:"+args;
};
Xap.provide("xap.util.XapExceptionRes");
xap.util.XapExceptionRes=function(){
};
Xap.provide("xap.util.XapException");
Xap.require("xap.util.ResourceDictionary");
Xap.require("xap.util.XapExceptionRes");
xap.util.XapException=function(_166,args,_168,_169){
if(_166){
this._msgId=_166;
this._localizedMessage=xap.util.ResourceDictionary.getMessage(_166,this.getClassName(),args);
this._cause=_168;
this._location=_169;
}
};
xap.util.XapException.CLASSNAME="xap.util.XapException";
xap.util.XapException.prototype.getCause=function(){
return this._cause;
};
xap.util.XapException.prototype.getLocation=function(){
return this._location;
};
xap.util.XapException.prototype.getMessageId=function(){
return this._msgId;
};
xap.util.XapException.prototype.getMessage=function(){
return this._localizedMessage;
};
xap.util.XapException.prototype.toString=function(){
return this._localizedMessage;
};
xap.util.XapException.prototype.getClassName=function(){
return xap.util.XapException.CLASSNAME;
};
xap.util.XapException.exceptionToString=function(_16a){
var s=new String();
if(!_16a){
return s;
}
if(_16a.name&&_16a.message){
s+="Exception: "+_16a.name+" - "+_16a.message+"\n";
}else{
if(_16a.getMessage){
s+="Exception: "+_16a.getMessage()+"\n";
}
}
if(_16a.getLocation&&_16a.getLocation()){
s+="Occurred at: "+_16a.getLocation()+"\n";
}
if(_16a.getCause&&_16a.getCause()){
s+="Caused by:\n"+xap.util.XapException.exceptionToString(_16a.getCause());
}
if(s.length==0&&_16a.toString){
s=_16a.toString();
}
if(s.length==0){
s=""+_16a;
}
return s;
};
Xap.provide("xap.xml.sax.ParserException");
Xap.require("xap.util.XapException");
xap.xml.sax.ParserException=function(_16c,args,_16e){
xap.util.XapException.call(this,_16c,args,_16e);
};
xap.xml.sax.ParserException.prototype=new xap.util.XapException;
xap.xml.sax.ParserException.DOCUMENT_HANDLER_MISSING="documentHandlerMissing";
xap.xml.sax.ParserException.FAILURE_TO_EXECUTE_INSTRUCTION="failedToExecuteInstruction";
xap.xml.sax.ParserException.NAMESPACE_HANDLER_FAILURE="namespaceHandlerFailure";
xap.xml.sax.ParserException.IOEXCEPTION_PARSING="ioexceptionParsing";
xap.xml.sax.ParserException.UNEXPECTED_EOF="unexpectedEOF";
xap.xml.sax.ParserException.WRONG_EVENT_TYPE="wrongEventType";
xap.xml.sax.ParserException.DEFINED_ENTITY_AFTER_SETINPUT="cantDefineEntitiesAfterSetInput";
xap.xml.sax.ParserException.UNEXPECTED_TAG="unexpectedTag";
xap.xml.sax.ParserException.UNSUPPORTED_FEATURE="unsupportedFeature";
xap.xml.sax.ParserException.EMPTY_NAMESPACES_NOT_ALLOWED="emptyNamespacesNotAllowed";
xap.xml.sax.ParserException.ILLEGAL_ATTRIBUTE_NAME="illegalAttributeName";
xap.xml.sax.ParserException.UNDEFINED_PREFIX="undefinedPrefix";
xap.xml.sax.ParserException.ILLEGAL_TAG_NAME="illegalTagName";
xap.xml.sax.ParserException.NO_INPUT_SPECIFIED="noInputSpecified";
xap.xml.sax.ParserException.PROCESSING_INSTR_CANNOT_START_WITH_XML="processingInstructionMustNotStartWithXml";
xap.xml.sax.ParserException.XML_VERSION_EXPECTED="xmlVersionExpected";
xap.xml.sax.ParserException.ILLEGAL_STANDALONE_VALUE="illegalStandaloneValue";
xap.xml.sax.ParserException.ILLEGAL_XML_DECLARATION="illegalXmlDeclaration";
xap.xml.sax.ParserException.ILLEGAL_OPENING_TAG="illegalOpeningTag";
xap.xml.sax.ParserException.ILLEGAL_COMMENT_DELIMITER="illegalCommentDelimiter";
xap.xml.sax.ParserException.ELEMENT_STACK_EMPTY="elementStackEmpty";
xap.xml.sax.ParserException.UNEXPECTED_END_TAG="unexpectedEndTag";
xap.xml.sax.ParserException.ATTRIBUTE_NAME_EXPECTED="attributeNameWasExpected";
xap.xml.sax.ParserException.ATTRIBUTE_VALUE_MISSING="attributeValueWasNotFound";
xap.xml.sax.ParserException.ATTRIBUTE_DELIMITER_MISSING="attributeValueDelimiterMissing";
xap.xml.sax.ParserException.UNTERMINATED_ENTITY="unterminatedEntityReference";
xap.xml.sax.ParserException.UNDEFINED_ENTITY="undefinedEntity";
xap.xml.sax.ParserException.ILLEGAL_END_OF_PROCESSING_INSTRUCTION="illegalEndOfProcessingInstruction";
xap.xml.sax.ParserException.UNEXPECTED_CHARACTER="unexpectedCharacter";
xap.xml.sax.ParserException.INVALID_XML_NAME_CHARACTERS="invalidXmlNameCharacters";
xap.xml.sax.ParserException.PARSER_MUST_BE_PARSERIMPL="parserMustBeParserImpl";
xap.xml.sax.ParserException.CHANGE_REJECTED_DURING_PARSE="changeRejectedDuringParse";
xap.xml.sax.ParserException.ONLY_ONE_ROOT_ELEMENT_PER_DOC="onlyOneRootElementCanExist";
xap.xml.sax.ParserException.CLASSNAME="xap.xml.sax.ParserException";
xap.xml.sax.ParserException.prototype.getClassName=function(){
return xap.xml.sax.ParserException.CLASSNAME;
};
Xap.provide("xap.log.Logger");
Xap.provide("xap.log.LoggingEvent");
Xap.provide("xap.log.ConsoleAppender");
Xap.require("xap.util.XapException");
xap.log.Logger=function(_16f){
this._name=_16f;
this._appenders=[];
this._childLogs={};
this._inheritedLevel=0;
this._level=0;
};
xap.log.Logger.prototype.addAppender=function(_170){
this._appenders.push(_170);
};
xap.log.Logger.prototype.setLevel=function(_171){
this._level=_171;
for(var i in this._childLogs){
this._childLogs[i]._setParent(this);
}
};
xap.log.Logger.prototype.getEffectiveLevel=function(){
return (this._level?this._level:(this._inheritedLevel?this._inheritedLevel:0));
};
xap.log.Logger.prototype.log=function(_173,_174,_175){
if(_173<this.getEffectiveLevel()){
return;
}
var _176=new xap.log.LoggingEvent(this._name,this,new Date(),_173,_174,_175);
this._dispatchLogEvent(_176);
};
xap.log.Logger.prototype.trace=function(_177,_178){
this.log(xap.log.Logger.TRACE,_177,_178);
};
xap.log.Logger.prototype.debug=function(_179,_17a){
this.log(xap.log.Logger.DEBUG,_179,_17a);
};
xap.log.Logger.prototype.info=function(_17b,_17c){
this.log(xap.log.Logger.INFO,_17b,_17c);
};
xap.log.Logger.prototype.warn=function(_17d,_17e){
this.log(xap.log.Logger.WARN,_17d,_17e);
};
xap.log.Logger.prototype.error=function(_17f,_180){
this.log(xap.log.Logger.ERROR,_17f,_180);
};
xap.log.Logger.prototype.fatal=function(_181,_182){
this.log(xap.log.Logger.FATAL,_181,_182);
};
xap.log.Logger.prototype.isEnabledFor=function(_183){
return (_183>=this.getEffectiveLevel());
};
xap.log.Logger.prototype.isTrace=function(){
return (xap.log.Logger.TRACE>=this.getEffectiveLevel());
};
xap.log.Logger.prototype.isDebug=function(){
return (xap.log.Logger.DEBUG>=this.getEffectiveLevel());
};
xap.log.Logger.prototype.isInfo=function(){
return (xap.log.Logger.INFO>=this.getEffectiveLevel());
};
xap.log.Logger.prototype.isWarn=function(){
return (xap.log.Logger.WARN>=this.getEffectiveLevel());
};
xap.log.Logger.prototype.isError=function(){
return (xap.log.Logger.ERROR>=this.getEffectiveLevel());
};
xap.log.Logger.prototype.isFatal=function(){
return (xap.log.Logger.FATAL>=this.getEffectiveLevel());
};
xap.log.Logger.prototype._dispatchLogEvent=function(_184){
for(var i=0;i<this._appenders.length;i++){
this._appenders[i].doAppend(_184);
}
if(this._parent){
this._parent._dispatchLogEvent(_184);
}
};
xap.log.Logger.prototype._setParent=function(_186){
this._parent=_186;
_186._childLogs[this._name]=this;
this._inheritedLevel=_186.getEffectiveLevel();
for(var i in this._childLogs){
this._childLogs[i]._setParent(this);
}
};
xap.log.Logger._rootLog=new xap.log.Logger("root");
xap.log.Logger._namesToLogs={};
xap.log.Logger.TRACE=1;
xap.log.Logger.DEBUG=2;
xap.log.Logger.INFO=3;
xap.log.Logger.WARN=4;
xap.log.Logger.ERROR=5;
xap.log.Logger.FATAL=6;
xap.log.Logger.NONE=7;
xap.log.Logger.LEVEL_NAMES=["","TRACE","DEBUG","INFO","WARN","ERROR","FATAL","NONE"];
xap.log.Logger.getRootLogger=function(){
return xap.log.Logger._rootLog;
};
xap.log.Logger.getLogger=function(_188){
var _189=xap.log.Logger._namesToLogs[_188];
if(!_189){
var _18a=_188.split(".");
var _18b=xap.log.Logger._rootLog;
for(var i=0;i<_18a.length;i++){
var _18d=_18a.slice(0,i+1).join(".");
_189=_18b._childLogs[_18d];
if(!_189){
_189=new xap.log.Logger(_18d);
xap.log.Logger._namesToLogs[_18d]=_189;
_189._setParent(_18b);
}
_18b=_189;
}
}
return _189;
};
xap.log.LoggingEvent=function(_18e,_18f,date,_191,_192,_193){
this.logName=_18e;
this.logger=_18f;
this.date=date;
this.level=_191;
this.message=_192;
this.exception=_193;
this._renderedMessage="["+date.getHours()+":"+date.getMinutes()+":"+date.getSeconds()+" "+xap.log.Logger.LEVEL_NAMES[_191]+" "+_18e+"] "+_192;
if(_193){
this._renderedMessage+=xap.util.XapException.exceptionToString(_193);
}
};
xap.log.LoggingEvent.prototype.getRenderedMessage=function(){
return this._renderedMessage;
};
xap.log.AlertAppender=function(){
};
xap.log.AlertAppender.prototype.doAppend=function(_194){
if(_194.level<xap.log.Logger.ERROR){
return;
}
alert(_194.getRenderedMessage());
};
xap.log.ConsoleAppender=function(){
xap.log.ConsoleAppender._log=this;
};
xap.log.ConsoleAppender.prototype.doAppend=function(_195){
this._logEvent(_195.getRenderedMessage(),true);
};
xap.log.ConsoleAppender.prototype._logEvent=function(text){
if(!this._logDiv){
var l=document.createElement("div");
l.style.position="absolute";
l.style.right="5px";
l.style.top="5px";
l.style.width="200px";
l.style.height="350px";
l.style.overflow="auto";
l.style.backgroundColor="#f0f0f0";
l.style.border="1px solid gray";
l.style.fontSize="10px";
l.style.padding="5px";
document.body.appendChild(l);
this._logDiv=l;
}
this._logDiv.style.display="block";
if(this._logDiv.innerHTML==""){
this._logDiv.innerHTML="<A HREF=\"javascript:xap.log.ConsoleAppender._log._clear()\">Clear</A><br/><A HREF=\"javascript:xap.log.ConsoleAppender._log._resizeOutput(true)\">Bigger</A> | <A HREF=\"javascript:xap.log.ConsoleAppender._log._resizeOutput(false)\">Smaller</A>";
}
this._logDiv.appendChild(document.createElement("br"));
this._logDiv.appendChild(document.createElement("br"));
this._logDiv.appendChild(document.createTextNode(text));
this._logDiv.scrollTop=this._logDiv.scrollHeight;
};
xap.log.ConsoleAppender.prototype._resizeOutput=function(_198){
if(_198){
this._logDiv.style.width=(parseInt(this._logDiv.style.width)+100)+"px";
this._logDiv.style.height=(parseInt(this._logDiv.style.height)+100)+"px";
}else{
this._logDiv.style.width=Math.max(parseInt(this._logDiv.style.width)-100,150)+"px";
this._logDiv.style.height=Math.max(parseInt(this._logDiv.style.height)-100,100)+"px";
}
};
xap.log.ConsoleAppender.prototype._clear=function(){
if(this._logDiv){
this._logDiv.style.display="none";
this._logDiv.innerHTML="";
}
};
Xap.provide("xap.xml.NamespaceHandlerManager");
Xap.require("xap.xml.sax.ParserException");
Xap.require("xap.util.Hashtable");
Xap.require("xap.util.Exception");
Xap.require("xap.log.Logger");
xap.xml.NamespaceHandlerManager=function(_199){
this._session=_199;
this._namespaceToHandlersMap=new xap.util.Hashtable();
};
xap.xml.NamespaceHandlerManager.s_log=xap.log.Logger.getLogger("xap.xml.NamespaceHandler");
xap.xml.NamespaceHandlerManager.prototype.dispatch=function(_19a){
var _19b=this._namespaceToHandlersMap.get(_19a.getNamespaceUri());
if(!_19b){
throw new xap.util.Exception("The namespace supplied ["+_19a.getNamespaceUri()+"] is not valid.");
}
try{
_19b.receiveDispatch(_19a);
}
catch(e){
xap.xml.NamespaceHandlerManager.s_log.error("Error dispatching element to namespace handler for namespace URI "+_19a.getNamespaceUri(),e);
}
};
xap.xml.NamespaceHandlerManager.prototype.addHandler=function(_19c,_19d){
this._namespaceToHandlersMap.put(_19c,_19d);
};
Xap.provide("xap.xml.dom.events.DomChangeEvent");
xap.xml.dom.events.DomChangeEvent=function(_19e){
this._sourceElement=_19e;
};
xap.xml.dom.events.DomChangeEvent.prototype.getSourceElement=function(){
return this._sourceElement;
};
Xap.provide("google.misc");
with(google){
google.xmlValue=function(node){
if(!node){
return "";
}
var ret="";
if(node.nodeType==DOM_TEXT_NODE||node.nodeType==DOM_CDATA_SECTION_NODE||node.nodeType==DOM_ATTRIBUTE_NODE){
ret+=node.nodeValue;
}else{
if(node.nodeType==DOM_ELEMENT_NODE||node.nodeType==DOM_DOCUMENT_NODE||node.nodeType==DOM_DOCUMENT_FRAGMENT_NODE){
for(var i=0;i<node.childNodes.length;++i){
ret+=arguments.callee(node.childNodes[i]);
}
}
}
return ret;
};
google.xmlText=function(node){
var ret="";
if(node.nodeType==DOM_TEXT_NODE){
ret+=xmlEscapeText(node.nodeValue);
}else{
if(node.nodeType==DOM_ELEMENT_NODE){
ret+="<"+node.nodeName;
for(var i=0;i<node.attributes.length;++i){
var a=node.attributes[i];
if(a&&a.nodeName&&a.nodeValue){
ret+=" "+a.nodeName;
ret+="=\""+xmlEscapeAttr(a.nodeValue)+"\"";
}
}
if(node.childNodes.length==0){
ret+="/>";
}else{
ret+=">";
for(var i=0;i<node.childNodes.length;++i){
ret+=arguments.callee(node.childNodes[i]);
}
ret+="</"+node.nodeName+">";
}
}else{
if(node.nodeType==DOM_DOCUMENT_NODE||node.nodeType==DOM_DOCUMENT_FRAGMENT_NODE){
for(var i=0;i<node.childNodes.length;++i){
ret+=arguments.callee(node.childNodes[i]);
}
}
}
}
return ret;
};
google.mapExec=function(_1a6,func){
for(var i=0;i<_1a6.length;++i){
func(_1a6[i]);
}
};
google.mapExpr=function(_1a9,func){
var ret=[];
for(var i=0;i<_1a9.length;++i){
ret.push(func(_1a9[i]));
}
return ret;
};
google.reverseInplace=function(_1ad){
for(var i=0;i<_1ad.length/2;++i){
var h=_1ad[i];
var ii=_1ad.length-i-1;
_1ad[i]=_1ad[ii];
_1ad[ii]=h;
}
};
google.copyArray=function(dst,src){
for(var i=0;i<src.length;++i){
dst.push(src[i]);
}
};
google.assert=function(b){
if(!b){
throw "assertion failed";
}
};
google.DOM_ELEMENT_NODE=1;
google.DOM_ATTRIBUTE_NODE=2;
google.DOM_TEXT_NODE=3;
google.DOM_CDATA_SECTION_NODE=4;
google.DOM_ENTITY_REFERENCE_NODE=5;
google.DOM_ENTITY_NODE=6;
google.DOM_PROCESSING_INSTRUCTION_NODE=7;
google.DOM_COMMENT_NODE=8;
google.DOM_DOCUMENT_NODE=9;
google.DOM_DOCUMENT_TYPE_NODE=10;
google.DOM_DOCUMENT_FRAGMENT_NODE=11;
google.DOM_NOTATION_NODE=12;
google.xpathdebug=false;
google.xsltdebug=false;
google.xmlEscapeText=function(s){
return s.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;");
};
google.xmlEscapeAttr=function(s){
return xmlEscapeText(s).replace(/\"/g,"&quot;");
};
google.xmlEscapeTags=function(s){
return s.replace(/</g,"&lt;").replace(/>/g,"&gt;");
};
google.logging__=false;
google.Log=function(){
};
Log.lines=[];
Log.write=function(s){
if(logging__){
this.lines.push(xmlEscapeText(s));
this.show();
}
};
Log.writeXML=function(xml){
if(logging__){
var s0=xml.replace(/</g,"\n<");
var s1=xmlEscapeText(s0);
var s2=s1.replace(/\s*\n(\s|\n)*/g,"<br/>");
this.lines.push(s2);
this.show();
}
};
Log.writeRaw=function(s){
if(logging__){
this.lines.push(s);
this.show();
}
};
Log.clear=function(){
if(logging__){
var l=this.div();
l.innerHTML="";
this.lines=[];
}
};
Log.show=function(){
var l=this.div();
l.innerHTML+=this.lines.join("<br/>")+"<br/>";
this.lines=[];
l.scrollTop=l.scrollHeight;
};
Log.div=function(){
var l=document.getElementById("log");
if(!l){
l=document.createElement("div");
l.id="log";
l.style.position="absolute";
l.style.right="5px";
l.style.top="5px";
l.style.width="250px";
l.style.height="150px";
l.style.overflow="auto";
l.style.backgroundColor="#f0f0f0";
l.style.border="1px solid gray";
l.style.fontSize="10px";
l.style.padding="5px";
document.body.appendChild(l);
}
return l;
};
}
Xap.require("google.misc");
Xap.provide("google.dom");
google.XNode=function(type,name,_1c3,_1c4){
this.attributes=[];
this.childNodes=[];
google.XNode.init.call(this,type,name,_1c3,_1c4);
};
with(google){
XNode.init=function(type,name,_1c7,_1c8){
this.nodeType=type-0;
this.nodeName=""+name;
this.nodeValue=""+_1c7;
this.ownerDocument=_1c8;
this.firstChild=null;
this.lastChild=null;
this.nextSibling=null;
this.previousSibling=null;
this.parentNode=null;
};
XNode.unused_=[];
XNode.recycle=function(node){
if(!node){
return;
}
if(node.constructor==google.XDocument){
XNode.recycle(node.documentElement);
return;
}
if(node.constructor!=this){
return;
}
XNode.unused_.push(node);
for(var a=0;a<node.attributes.length;++a){
XNode.recycle(node.attributes[a]);
}
for(var c=0;c<node.childNodes.length;++c){
XNode.recycle(node.childNodes[c]);
}
node.attributes.length=0;
node.childNodes.length=0;
XNode.init.call(node,0,"","",null);
};
XNode.create=function(type,name,_1ce,_1cf){
if(XNode.unused_.length>0){
var node=XNode.unused_.pop();
XNode.init.call(node,type,name,_1ce,_1cf);
return node;
}else{
return new XNode(type,name,_1ce,_1cf);
}
};
XNode.prototype.appendChild=function(node){
if(this.childNodes.length==0){
this.firstChild=node;
}
node.previousSibling=this.lastChild;
node.nextSibling=null;
if(this.lastChild){
this.lastChild.nextSibling=node;
}
node.parentNode=this;
this.lastChild=node;
this.childNodes.push(node);
};
XNode.prototype.replaceChild=function(_1d2,_1d3){
if(_1d3==_1d2){
return;
}
for(var i=0;i<this.childNodes.length;++i){
if(this.childNodes[i]==_1d3){
this.childNodes[i]=_1d2;
var p=_1d3.parentNode;
_1d3.parentNode=null;
_1d2.parentNode=p;
p=_1d3.previousSibling;
_1d3.previousSibling=null;
_1d2.previousSibling=p;
if(_1d2.previousSibling){
_1d2.previousSibling.nextSibling=_1d2;
}
p=_1d3.nextSibling;
_1d3.nextSibling=null;
_1d2.nextSibling=p;
if(_1d2.nextSibling){
_1d2.nextSibling.previousSibling=_1d2;
}
if(this.firstChild==_1d3){
this.firstChild=_1d2;
}
if(this.lastChild==_1d3){
this.lastChild=_1d2;
}
break;
}
}
};
XNode.prototype.insertBefore=function(_1d6,_1d7){
if(_1d7==_1d6){
return;
}
if(_1d7.parentNode!=this){
return;
}
if(_1d6.parentNode){
_1d6.parentNode.removeChild(_1d6);
}
var _1d8=[];
for(var i=0;i<this.childNodes.length;++i){
var c=this.childNodes[i];
if(c==_1d7){
_1d8.push(_1d6);
_1d6.parentNode=this;
_1d6.previousSibling=_1d7.previousSibling;
_1d7.previousSibling=_1d6;
if(_1d6.previousSibling){
_1d6.previousSibling.nextSibling=_1d6;
}
_1d6.nextSibling=_1d7;
if(this.firstChild==_1d7){
this.firstChild=_1d6;
}
}
_1d8.push(c);
}
this.childNodes=_1d8;
};
XNode.prototype.removeChild=function(node){
var _1dc=[];
for(var i=0;i<this.childNodes.length;++i){
var c=this.childNodes[i];
if(c!=node){
_1dc.push(c);
}else{
if(c.previousSibling){
c.previousSibling.nextSibling=c.nextSibling;
}
if(c.nextSibling){
c.nextSibling.previousSibling=c.previousSibling;
}
if(this.firstChild==c){
this.firstChild=c.nextSibling;
}
if(this.lastChild==c){
this.lastChild=c.previousSibling;
}
}
}
this.childNodes=_1dc;
};
XNode.prototype.hasAttributes=function(){
return this.attributes.length>0;
};
XNode.prototype.setAttribute=function(name,_1e0,_1e1){
for(var i=0;i<this.attributes.length;++i){
if(this.attributes[i].nodeName==name){
this.attributes[i].nodeValue=""+_1e0;
if(_1e1){
this.attributes[i].baseUrl=_1e1;
}else{
if(this.attributes[i].baseUrl){
delete this.attributes[i].baseUrl;
}
}
return;
}
}
var _1e3=new XNode(DOM_ATTRIBUTE_NODE,name,_1e0);
if(_1e1){
_1e3.baseUrl=_1e1;
}
this.attributes.push(_1e3);
};
XNode.prototype.getAttribute=function(name){
for(var i=0;i<this.attributes.length;++i){
if(this.attributes[i].nodeName==name){
return this.attributes[i].nodeValue;
}
}
return null;
};
XNode.prototype.removeAttribute=function(name){
var a=[];
for(var i=0;i<this.attributes.length;++i){
if(this.attributes[i].nodeName!=name){
a.push(this.attributes[i]);
}
}
this.attributes=a;
};
XNode.prototype.getElementsByTagName=function(name,list){
if(!list){
list=[];
}
if(this.nodeName==name){
list.push(this);
}
for(var i=0;i<this.childNodes.length;++i){
this.childNodes[i].getElementsByTagName(name,list);
}
return list;
};
}
google.XDocument=function(){
google.XNode.call(this,google.DOM_DOCUMENT_NODE,"#document",null,this);
this.documentElement=null;
};
with(google){
XDocument.prototype=new XNode(DOM_DOCUMENT_NODE,"#document");
XDocument.prototype.clear=function(){
XNode.recycle(this.documentElement);
this.documentElement=null;
};
XDocument.prototype.appendChild=function(node){
XNode.prototype.appendChild.call(this,node);
this.documentElement=this.childNodes[0];
};
XDocument.prototype.createElement=function(name){
return XNode.create(DOM_ELEMENT_NODE,name,null,this);
};
XDocument.prototype.createDocumentFragment=function(){
return XNode.create(DOM_DOCUMENT_FRAGMENT_NODE,"#document-fragment",null,this);
};
XDocument.prototype.createTextNode=function(_1ee){
return XNode.create(DOM_TEXT_NODE,"#text",_1ee,this);
};
XDocument.prototype.createAttribute=function(name){
return XNode.create(DOM_ATTRIBUTE_NODE,name,null,this);
};
XDocument.prototype.createComment=function(data){
return XNode.create(DOM_COMMENT_NODE,"#comment",data,this);
};
}
Xap.provide("xap.xml.dom.events.StructureChangeEvent");
Xap.require("xap.xml.dom.events.DomChangeEvent");
Xap.require("google.dom");
xap.xml.dom.events.StructureChangeEvent=function(_1f1,_1f2,_1f3){
xap.xml.dom.events.DomChangeEvent.call(this,_1f1);
this._change=_1f2;
this._index=_1f3;
if(_1f1==null){
this._eventType=xap.xml.dom.events.StructureChangeEvent.ROOT_NODE;
}else{
if(_1f2.nodeType==google.DOM_ELEMENT_NODE){
this._eventType=xap.xml.dom.events.StructureChangeEvent.ELEMENT_NODE;
}else{
this._eventType=xap.xml.dom.events.StructureChangeEvent.TEXT_NODE;
}
}
};
xap.xml.dom.events.StructureChangeEvent.prototype=new xap.xml.dom.events.DomChangeEvent;
xap.xml.dom.events.StructureChangeEvent.ELEMENT_NODE=0;
xap.xml.dom.events.StructureChangeEvent.TEXT_NODE=1;
xap.xml.dom.events.StructureChangeEvent.ROOT_NODE=2;
xap.xml.dom.events.StructureChangeEvent.prototype.getIndex=function(){
return this._index;
};
xap.xml.dom.events.StructureChangeEvent.prototype.getType=function(){
return this._eventType;
};
xap.xml.dom.events.StructureChangeEvent.prototype.getChange=function(){
return this._change;
};
xap.xml.dom.events.StructureChangeEvent.prototype.setChange=function(_1f4){
if(this._eventType==xap.xml.dom.events.StructureChangeEvent.ROOT_NODE){
if(_1f4.nodeType!=google.DOM_ELEMENT_NODE){
throw new xap.util.Exception("The root element of xap.xml.dom.Documents must be of type Element");
}
}else{
if(_1f4.nodeType==google.DOM_ELEMENT_NODE){
this._eventType=xap.xml.dom.events.StructureChangeEvent.ELEMENT_NODE;
}else{
this._eventType=xap.xml.dom.events.StructureChangeEvent.TEXT_NODE;
}
}
this._change=_1f4;
};
Xap.provide("xap.xml.dom.events.AttributeChangeEvent");
Xap.require("xap.xml.dom.events.DomChangeEvent");
xap.xml.dom.events.AttributeChangeEvent=function(_1f5,name,_1f7){
xap.xml.dom.events.DomChangeEvent.call(this,_1f5);
this._attributeName=name;
this._oldValue=_1f5.getAttribute(this._attributeName);
this._newValue=_1f7;
};
xap.xml.dom.events.AttributeChangeEvent.prototype=new xap.xml.dom.events.DomChangeEvent;
xap.xml.dom.events.AttributeChangeEvent.prototype.getName=function(){
return this._attributeName;
};
xap.xml.dom.events.AttributeChangeEvent.prototype.getOldValue=function(){
return this._oldValue;
};
xap.xml.dom.events.AttributeChangeEvent.prototype.getNewValue=function(){
return this._newValue;
};
xap.xml.dom.events.AttributeChangeEvent.prototype.setNewValue=function(_1f8){
if(_1f8==null){
throw new xap.util.Exception("Can't set the attribute value as null");
}
var _1f9=this.getSourceElement().getAttribute(this.getName());
if(_1f9!=null&&_1f9!=this._oldValue){
throw new xap.util.Exception("You may only change the new value of attributes "+"before the change has been committed (accepted by "+"all registered xap.xml.dom.events.AttributeChangeListener objects)");
}
if(this._newValue!=null&&this._newValue==this._oldValue){
}
this._newValue=_1f8;
};
Xap.provide("xap.util.Character");
xap.util.Character=function(){
};
xap.util.Character._reLetter=/^[a-zA-Z]$/;
xap.util.Character._reDigit=/^\d/;
xap.util.Character._reLetterOrDigit=/^([a-zA-Z]|\d)$/;
xap.util.Character._reWhitespace=/^(\s)*$/;
xap.util.Character.isLetter=function(c){
return xap.util.Character._reLetter.test(c);
};
xap.util.Character.isDigit=function(c){
return xap.util.Character._reDigit.test(c);
};
xap.util.Character.isLetterOrDigit=function(c){
return xap.util.Character._reLetterOrDigit.test(c);
};
xap.util.Character.isWhiteSpaceChar=function(c){
return (c==" "||c=="\n"||c=="\t"||c=="\r");
};
xap.util.Character.isWhiteSpace=function(str){
return xap.util.Character._reWhitespace.test(str);
};
Xap.provide("xap.util.XmlUtils");
Xap.require("xap.util.Character");
xap.util.XmlUtils=function(){
};
xap.util.XmlUtils.encode=function(s){
if(s==null){
return "";
}
var _200=new Array(s.length);
var c;
for(var i=0;i<s.length;i++){
c=s.charAt(i);
if(c=="&"){
_200[i]="&amp;";
}else{
if(c=="<"){
_200[i]="&lt;";
}else{
if(c==">"){
_200[i]="&gt;";
}else{
if(c=="'"){
_200[i]="&apos;";
}else{
if(c=="\""){
_200[i]="&quot;";
}else{
_200[i]=c;
}
}
}
}
}
}
return _200.join("");
};
xap.util.XmlUtils.encodeDoubleQuotes=function(s){
if(s==null){
return "";
}
var _204=new Array(s.length);
var c;
for(var i=0;i<s.length;i++){
c=s.charAt(i);
if(c=="\""){
_204[i]="&quot;";
}else{
_204[i]=c;
}
}
return _204.join("");
};
xap.util.XmlUtils.decode=function(str){
if(str==null){
return "";
}
var _208=new Array(str.length);
var s=str.toLowerCase();
var c;
for(var i=0;i<s.length;i++){
c=s.charAt(i);
if(c=="&"){
if(s.indexOf("&amp;",i)!=-1){
_208[i]="&";
i+=4;
}else{
if(s.indexOf("&lt;",i)!=-1){
_208[i]="<";
i+=3;
}else{
if(s.indexOf("&gt;",i)!=-1){
_208[i]=">";
i+=3;
}else{
if(s.indexOf("&apos;",i)!=-1){
_208[i]="'";
i+=5;
}else{
if(s.indexOf("&quot;",i)!=-1){
_208[i]="\"";
i+=5;
}else{
_208[i]=c;
}
}
}
}
}
}else{
_208[i]=c;
}
}
return _208.join("");
};
Xap.provide("xap.util.UidProvider");
xap.util.UidProvider.XAP_ID_PREFIX="xap:";
xap.util.UidProvider.s_count=0;
xap.util.UidProvider.s_seed=new Date().getTime();
xap.util.UidProvider.createId=function(){
return new String(xap.util.UidProvider.XAP_ID_PREFIX+xap.util.UidProvider.s_seed+(xap.util.UidProvider.s_count++));
};
Xap.provide("xap.util.ArrayHelper");
xap.util.ArrayHelper=function(){
};
xap.util.ArrayHelper.insertElementAt=function(_20c,_20d,_20e){
return _20c.splice(_20e,0,_20d);
};
xap.util.ArrayHelper.removeElement=function(_20f,_210){
var i=xap.util.ArrayHelper.indexOf(_20f,_210);
if(i<0){
return _20f;
}
return _20f.splice(i,1);
};
xap.util.ArrayHelper.removeElementAt=function(_212,_213){
return _212.splice(_213,1);
};
xap.util.ArrayHelper.indexOf=function(_214,_215){
for(var i=0;i<_214.length;i++){
if(_214[i]==_215){
return i;
}
}
return -1;
};
xap.util.ArrayHelper.contains=function(_217,_218){
return xap.util.ArrayHelper.indexOf(_217,_218)>=0;
};
xap.util.ArrayHelper.clone=function(_219){
var _21a=new Array(_219.length);
for(var i=0;i<_219.length;i++){
_21a[i]=_219[i];
}
return _21a;
};
xap.util.ArrayHelper.pushAll=function(_21c,_21d){
for(var i=0;i<_21d.length;i++){
_21c.push(_21d[i]);
}
return _21c;
};
xap.util.ArrayHelper.unique=function(arr){
if(!arr){
return arr;
}
var _220=new Object();
var _221=[];
for(var ii=0;ii<arr.length;++ii){
var elem=arr[ii];
if(!_220[elem]){
_221.push(elem);
_220[elem]=true;
}
}
return _221;
};
Xap.provide("xap.xml.dom.events.ChangeRejectedExceptionRes");
xap.xml.dom.events.ChangeRejectedExceptionRes=function(){
this.messages=new Object();
this.messages[xap.xml.dom.events.ChangeRejectedException.CHANGE_ATTRIBUTE_TO_NULL_MSGID]="One of the xap.xml.dom.events.AttributeChangeListeners set the attribute value to null which is not allowed.";
this.messages[xap.xml.dom.events.ChangeRejectedException.CHANGE_CHILD_TO_NULL_MSGID]="One of the xap.xml.dom.events.StructureChangeListeners set the child to null which cannot be placed in the DOM.";
this.messages[xap.xml.dom.events.ChangeRejectedException.REJECTED_WITH_REASON_MSGID]="The change was rejected because {0}";
this.messages[xap.xml.dom.events.ChangeRejectedException.ROOT_NODE_CHANGE_DISALLOWED_MSGID]="This document does not support setting the root node.";
};
Xap.provide("xap.xml.dom.events.ChangeRejectedException");
Xap.require("xap.xml.dom.events.ChangeRejectedExceptionRes");
Xap.require("xap.util.XapException");
xap.xml.dom.events.ChangeRejectedException=function(_224,args,_226,_227){
xap.util.XapException.call(this,_224,args,_226);
this._event=_227;
};
xap.xml.dom.events.ChangeRejectedException.prototype=new xap.util.XapException;
xap.xml.dom.events.ChangeRejectedException.CLASSNAME="xap.xml.dom.events.ChangeRejectedException";
xap.xml.dom.events.ChangeRejectedException.CHANGE_ATTRIBUTE_TO_NULL_MSGID="listenerChangedAttributeToNull";
xap.xml.dom.events.ChangeRejectedException.CHANGE_CHILD_TO_NULL_MSGID="listenerChangedChildToNull";
xap.xml.dom.events.ChangeRejectedException.REJECTED_WITH_REASON_MSGID="rejectedWithReason";
xap.xml.dom.events.ChangeRejectedException.ROOT_NODE_CHANGE_DISALLOWED_MSGID="rootNodeChangeDisallowed";
xap.xml.dom.events.ChangeRejectedException.prototype.getEvent=function(){
return this._event;
};
xap.xml.dom.events.ChangeRejectedException.prototype.getClassName=function(){
return xap.xml.dom.events.ChangeRejectedException.CLASSNAME;
};
Xap.provide("xap.xml.dom.XapElement");
Xap.require("xap.xml.dom.events.StructureChangeEvent");
Xap.require("xap.xml.dom.events.AttributeChangeEvent");
Xap.require("xap.util.XmlUtils");
Xap.require("xap.util.UidProvider");
Xap.require("xap.util.ResourceDictionary");
Xap.require("google.dom");
Xap.require("xap.util.ArrayHelper");
Xap.require("xap.xml.dom.events.ChangeRejectedException");
Xap.require("xap.log.Logger");
xap.xml.dom.XapElement=function(_228,_229,_22a,id){
google.XNode.call(this,google.DOM_ELEMENT_NODE,_228,null,_229);
this._namespaceUri=null;
this._prefix=null;
this._documentOwnershipListeners=[];
this._attributeChangeListeners=[];
this._structureChangeListeners=[];
if(id){
this.setAttribute("id",id);
}else{
this.setAttribute("id",xap.util.UidProvider.createId());
}
};
xap.xml.dom.XapElement.prototype=new google.XNode();
xap.xml.dom.XapElement.prototype.constructor=xap.xml.dom.XapElement;
xap.xml.dom.XapElement.CANNOT_SET_ID_ATTRIBUTE_WHEN_PART_OF_DOCUMENT="cannotSetIdAttributeWhenPartOfOwnerDocument";
xap.xml.dom.XapElement.DOC_OWNERSHIP_FAILURE="docOwnershipNotificationFailure";
xap.xml.dom.XapElement.CLASSNAME="xap.xml.dom.XapElement";
xap.xml.dom.XapElement.INDENT="  ";
xap.xml.dom.XapElement.s_log=xap.log.Logger.getLogger("xap.xml.dom.DocumentObjectModel");
xap.xml.dom.XapElement.isGeneratedId=function(id){
return (id&&id.indexOf(xap.util.UidProvider.XAP_ID_PREFIX,0)!=-1);
};
xap.xml.dom.XapElement._writeIndent=function(sbuf,_22e){
for(var i=0;i<_22e;i++){
sbuf+=xap.xml.dom.XapElement.INDENT;
}
};
xap.xml.dom.XapElement.prototype.getAttributeAsUrl=function(name){
var att=null;
for(var i=0;i<this.attributes.length;++i){
if(this.attributes[i].nodeName==name){
att=this.attributes[i];
}
}
if(att===null){
return null;
}
var _233=att.nodeValue;
var _234=att.baseUrl;
_234=_234||this.baseUrl||"";
return (_234+_233);
};
xap.xml.dom.XapElement.prototype.setAttribute=function(name,_236,_237){
var doc=this.ownerDocument;
if("id"==name){
if(doc){
throw new xap.util.Exception(xap.util.ResourceDictionary.getMessage(xap.xml.dom.XapElement.CANNOT_SET_ID_ATTRIBUTE_WHEN_PART_OF_DOCUMENT,xap.xml.dom.XapElement.CLASSNAME));
}
}
if(this._doAnyAttributeChangeListenersExist(doc)){
var _239=new xap.xml.dom.events.AttributeChangeEvent(this,name,_236);
this._fireAttributeChangeEvent(doc,_239,"beforeAttributeSet");
_236=_239.getNewValue();
if(_236===null){
throw new xap.xml.dom.events.ChangeRejectedException(xap.xml.dom.events.ChangeRejectedException.CHANGE_ATTRIBUTE_TO_NULL_MSGID,null,null,_239);
}
google.XNode.prototype.setAttribute.call(this,name,_236,_237);
this._fireAttributeChangeEvent(doc,_239,"onAttributeSet");
}else{
google.XNode.prototype.setAttribute.call(this,name,_236,_237);
}
};
xap.xml.dom.XapElement.prototype.removeAttribute=function(name){
var doc=this.ownerDocument;
if(doc&&(name=="id")){
throw new xap.util.Exception(xap.util.ResourceDictionary.getMessage(xap.xml.dom.XapElement.CANNOT_SET_ID_ATTRIBUTE_WHEN_PART_OF_DOCUMENT,xap.xml.dom.XapElement.CLASSNAME));
}
var _23c=new xap.xml.dom.events.AttributeChangeEvent(this,name,null);
this._fireAttributeChangeEvent(doc,_23c,"beforeAttributeRemoved");
google.XNode.prototype.removeAttribute.call(this,name);
this._fireAttributeChangeEvent(doc,_23c,"onAttributeRemoved");
if(name=="id"){
setAttribute("id",xap.util.UidProvider.createId());
}
};
xap.xml.dom.XapElement.prototype.insertBefore=function(_23d,_23e){
return this._insertBefore(_23d,_23e);
};
xap.xml.dom.XapElement.prototype.appendChild=function(_23f){
return this._insertBefore(_23f,null);
};
xap.xml.dom.XapElement.prototype.insertChildAt=function(_240,_241){
var _242=this.childNodes.length;
if(_240>_242){
var _243=new xap.xml.dom.events.StructureChangeEvent(this,_241,_240);
throw new xap.xml.dom.events.ChangeRejectedException(xap.xml.dom.events.ChangeRejectedException.REJECTED_WITH_REASON_MSGID,["Attempted to insert at invalid index: "+_240+", last child is at "+_242],null,_243);
}
var _244=null;
if(_240==_242){
_244=this.appendChild(_241);
}else{
_244=this.insertBefore(_241,this.childNodes[_240]);
}
return _244;
};
xap.xml.dom.XapElement.prototype.removeChild=function(_245){
var _246=xap.util.ArrayHelper.indexOf(this.childNodes,_245);
if((!_245)||(_246==-1)){
return null;
}
var doc=this.ownerDocument;
var _248=this._doAnyStructureChangeListenersExist(doc);
var _249=null;
if(_248){
_249=new xap.xml.dom.events.StructureChangeEvent(this,_245,_246);
this._fireStructureChangeEvent(doc,_249,"beforeChildRemoved");
}
google.XNode.prototype.removeChild.call(this,_245);
if(_245.nodeType==google.DOM_ELEMENT_NODE){
if(doc){
doc._removeDocumentFragmentFromIdMap(_245);
}
}
if(_248){
this._fireStructureChangeEvent(doc,_249,"onChildRemoved");
}
return _245;
};
xap.xml.dom.XapElement.prototype.getParent=function(){
if(!this.parentNode||(this.parentNode.nodeType!=google.DOM_ELEMENT_NODE)){
return null;
}
return this.parentNode;
};
xap.xml.dom.XapElement.prototype.getPrefix=function(){
return this._prefix;
};
xap.xml.dom.XapElement.prototype.getNamespaceUri=function(){
return this._namespaceUri;
};
xap.xml.dom.XapElement.prototype.getLocalName=function(){
return this.nodeName;
};
xap.xml.dom.XapElement.prototype.toXml=function(_24a){
var sbuf="";
sbuf=this._toStringHelper(this,sbuf,0,_24a,true);
return sbuf;
};
xap.xml.dom.XapElement.prototype.toXmlWithoutAutoAssignedIds=function(_24c){
var sbuf="";
sbuf=this._toStringHelper(this,sbuf,0,_24c,false);
return sbuf;
};
xap.xml.dom.XapElement.prototype.addAttributeChangeListener=function(_24e){
this._getAttributeChangeListeners().push(_24e);
};
xap.xml.dom.XapElement.prototype.removeAttributeChangeListener=function(_24f){
xap.util.ArrayHelper.removeElement(this._getAttributeChangeListeners(),_24f);
};
xap.xml.dom.XapElement.prototype.addStructureChangeListener=function(_250){
this._getStructureChangeListeners().push(_250);
};
xap.xml.dom.XapElement.prototype.removeStructureChangeListener=function(_251){
xap.util.ArrayHelper.removeElement(this._getStructureChangeListeners(),_251);
};
xap.xml.dom.XapElement.prototype.addDocumentOwnershipListener=function(_252){
this._getDocumentOwnershipListeners().push(_252);
};
xap.xml.dom.XapElement.prototype.removeDocumentOwnershipListener=function(_253){
xap.util.ArrayHelper.removeElement(this._getDocumentOwnershipListeners(),_253);
};
xap.xml.dom.XapElement.prototype.clone=function(){
return this._cloneHelper(false);
};
xap.xml.dom.XapElement.prototype.deepClone=function(){
return this._cloneHelper(true);
};
xap.xml.dom.XapElement.prototype._insertBefore=function(_254,_255){
var _256=this.childNodes.length;
if(_255){
_256=xap.util.ArrayHelper.indexOf(this.childNodes,_255);
if(_256==-1){
throw new xap.xml.dom.events.ChangeRejectedException(xap.xml.dom.events.ChangeRejectedException.REJECTED_WITH_REASON_MSGID,["Attempted to insert before at invalid node"],null,null);
}
}
var doc=this.ownerDocument;
var _258=this._doAnyStructureChangeListenersExist(doc);
var _259=null;
if(_258){
_259=new xap.xml.dom.events.StructureChangeEvent(this,_254,_256);
this._fireStructureChangeEvent(doc,_259,"beforeChildAdded");
_254=_259.getChange();
if(!_254){
throw new xap.xml.dom.events.ChangeRejectedException(xap.xml.dom.events.ChangeRejectedException.CHANGE_CHILD_TO_NULL_MSGID,null,null,_259);
}
}
var _25a=(_254.nodeType==google.DOM_ELEMENT_NODE);
if(_25a){
if(_254.ownerDocument){
if(_254.ownerDocument.getRootElement()==_254){
_254.ownerDocument.setRootElement(null);
}
delete _254.ownerDocument;
}
if(doc){
doc._addDocumentFragmentToIdMapAndCheckForPrefixCollisions(_254);
}
}
if(_255){
google.XNode.prototype.insertBefore.call(this,_254,_255);
}else{
google.XNode.prototype.appendChild.call(this,_254);
}
if(_258){
this._fireStructureChangeEvent(doc,_259,"onChildAdded");
}
return _254;
};
xap.xml.dom.XapElement.prototype._setNamespaceUri=function(ns){
this._namespaceUri=ns;
};
xap.xml.dom.XapElement.prototype._setPrefix=function(_25c){
this._prefix=_25c;
};
xap.xml.dom.XapElement.prototype._notifyListenersOnRemovedFromDocument=function(doc){
var _25e=this._getDocumentOwnershipListeners();
for(var i=0;i<_25e.length;i++){
var _260=_25e[i];
try{
_260.onRemovedFromDocument(doc);
if(_25e[i]!=_260){
i=i-1;
}
}
catch(t){
xap.xml.dom.XapElement.s_log.error(xap.util.ResourceDictionary.getMessage(xap.xml.dom.XapElement.DOC_OWNERSHIP_FAILURE,xap.xml.dom.XapElement.CLASSNAME),t);
}
}
};
xap.xml.dom.XapElement.prototype._notifyListenersOnAddedToDocument=function(doc){
var _262=this._getDocumentOwnershipListeners();
for(var i=0;i<_262.length;i++){
var _264=_262[i];
try{
_264.onAddedToDocument(doc);
if(_262[i]!=_264){
i=i-1;
}
}
catch(e){
xap.xml.dom.XapElement.s_log.error(xap.util.ResourceDictionary.getMessage(xap.xml.dom.XapElement.DOC_OWNERSHIP_FAILURE,xap.xml.dom.XapElement.CLASSNAME),e);
}
}
};
xap.xml.dom.XapElement.prototype._getAttributeChangeListeners=function(){
return this._attributeChangeListeners;
};
xap.xml.dom.XapElement.prototype._getStructureChangeListeners=function(){
return this._structureChangeListeners;
};
xap.xml.dom.XapElement.prototype._getDocumentOwnershipListeners=function(){
return this._documentOwnershipListeners;
};
xap.xml.dom.XapElement.prototype._toStringHelper=function(node,sbuf,_267,_268,_269){
if(node.nodeType==google.DOM_TEXT_NODE){
sbuf+=xap.util.XmlUtils.encode(node.nodeValue);
}else{
if(_268&&node.getParent()){
var _26a=xap.util.ArrayHelper.indexOf(node.getParent().childNodes,node);
if(_26a==-1){
}else{
if(_26a===0||(node.getParent().childNodes[_26a-1].nodeType==google.DOM_ELEMENT_NODE)){
sbuf+="\n";
xap.xml.dom.XapElement._writeIndent(sbuf,_267);
}
}
}
sbuf+="<";
if(node.getPrefix()){
sbuf+=node.getPrefix()+":";
}
sbuf+=node.getLocalName();
var _26b=false;
if(node.getNamespaceUri()!==null){
if(node.getParent()){
var myNS=node.getNamespaceUri();
var _26d=node.getParent().getNamespaceUri();
if(_26d===null||myNS!=_26d){
_26b=true;
}
}else{
_26b=true;
}
}
if(_26b===true){
sbuf+=" ";
if(node.getPrefix()){
sbuf+="xmlns:"+node.getPrefix();
}else{
sbuf+="xmlns";
}
sbuf+="=\""+xap.util.XmlUtils.encode(node.getNamespaceUri())+"\"";
}
for(var i=0;i<node.attributes.length;i++){
var key=node.attributes[i].nodeName;
var _270=node.attributes[i].nodeValue;
if(!_269){
if("id"==key&&xap.xml.dom.XapElement.isGeneratedId(_270)){
continue;
}
}
sbuf+=" "+key+"=\"";
sbuf+=xap.util.XmlUtils.encode(_270);
sbuf+="\"";
}
if(node.childNodes.length===0){
sbuf+="/>";
}else{
sbuf+=">";
var _271=false;
for(var j=0;j<node.childNodes.length;j++){
var _273=node.childNodes[j];
if(_273.nodeType==google.DOM_TEXT_NODE){
_271=true;
}
sbuf=this._toStringHelper(_273,sbuf,_267+1,_268,_269);
}
if(_268&&(_271===false)){
sbuf+="\n";
xap.xml.dom.XapElement._writeIndent(sbuf,_267);
}
sbuf+="</";
if(node.getPrefix()){
sbuf+=node.getPrefix()+":";
}
sbuf+=node.getLocalName()+">";
}
}
return sbuf;
};
xap.xml.dom.XapElement.prototype._fireStructureChangeEvent=function(doc,_275,_276){
if(doc){
this._notifyListeners(doc._structureChangeListeners,_275,_276);
}
this._notifyListeners(this._getStructureChangeListeners(),_275,_276);
};
xap.xml.dom.XapElement.prototype._fireAttributeChangeEvent=function(doc,_278,_279){
if(doc){
this._notifyListeners(doc._attributeChangeListeners,_278,_279);
}
this._notifyListeners(this._getAttributeChangeListeners(),_278,_279);
};
xap.xml.dom.XapElement.prototype._notifyListeners=function(_27a,_27b,_27c){
if(!_27a){
return;
}
for(var i=0;i<_27a.length;i++){
var _27e=_27a[i];
if(_27e[_27c]){
_27e[_27c].call(_27e,_27b);
if(_27a[i]!=_27e){
i=i-1;
}
}
}
};
xap.xml.dom.XapElement.prototype._doAnyAttributeChangeListenersExist=function(doc){
return ((doc&&doc._attributeChangeListeners.length>0)||(this._getAttributeChangeListeners().length>0));
};
xap.xml.dom.XapElement.prototype._doAnyStructureChangeListenersExist=function(doc){
return ((doc&&doc._structureChangeListeners.length>0)||(this._getStructureChangeListeners().length>0));
};
xap.xml.dom.XapElement.prototype.indexOfChild=function(_281){
return xap.util.ArrayHelper.indexOf(this.childNodes,_281);
};
xap.xml.dom.XapElement.prototype.getChildCount=function(){
return this.childNodes.length;
};
xap.xml.dom.XapElement.prototype.getChildAt=function(_282){
if(_282<this.childNodes.length){
return this.childNodes[_282];
}
return null;
};
xap.xml.dom.XapElement.getFirstTextChild=function(node){
var _284=node.childNodes;
if(!_284){
return null;
}
for(var i=0;_284.length;i++){
if(_284[i].nodeType==google.DOM_TEXT_NODE){
return (_284[i]);
}
}
return null;
};
xap.xml.dom.XapElement.prototype._cloneHelper=function(deep){
var e=new xap.xml.dom.XapElement(this.nodeName);
e._setNamespaceUri(this._namespaceUri);
e._setPrefix(this._prefix);
for(var i=0;i<this.attributes.length;i++){
e.setAttribute(this.attributes[i].nodeName,this.attributes[i].nodeValue,this.attributes[i].baseUrl);
}
if(this.baseUrl){
e.baseUrl=this.baseUrl;
}
var id=e.getAttribute("id");
if(xap.xml.dom.XapElement.isGeneratedId(id)){
e.setAttribute("id",xap.util.UidProvider.createId());
}
if(deep===false){
return e;
}
for(var j=0;j<this.childNodes.length;j++){
var o=this.childNodes[j];
if(o.nodeType==google.DOM_ELEMENT_NODE){
e.appendChild(o._cloneHelper(deep));
}else{
if(o.nodeType==google.DOM_TEXT_NODE){
var _28c=google.XNode.create(google.DOM_TEXT_NODE,null,o.nodeValue,null);
e.appendChild(_28c);
}
}
}
return e;
};
Xap.provide("xap.xml.InvalidXmlException");
Xap.require("xap.util.XapException");
xap.xml.InvalidXmlException=function(_28d,args,_28f){
xap.util.XapException.call(this,_28d,args,_28f);
};
xap.xml.InvalidXmlException.prototype=new xap.util.XapException;
xap.xml.InvalidXmlException.CLASSNAME="xap.xml.InvalidXmlException";
xap.xml.InvalidXmlException.MISSING_ATTRIBUTE_MSGID="missingAttribute";
xap.xml.InvalidXmlException.NULL_LOCALNAME_MSGID="nullLocalName";
xap.xml.InvalidXmlException.ID_CONFLICT_MSGID="idConflict";
xap.xml.InvalidXmlException.PREFIX_CONFLICT_MSGID="prefixConflict";
xap.xml.InvalidXmlException.BAD_ATTRIBUTE_WITH_ROOT_CAUSE="badAttributeCausedBy";
xap.xml.InvalidXmlException.prototype.toString=function(){
var buf="[InvalidXmlException:\t"+xap.util.XapException.prototype.toString.call(this)+"]";
return buf;
};
xap.xml.InvalidXmlException.prototype.getClassName=function(){
return xap.xml.InvalidXmlException.CLASSNAME;
};
Xap.provide("xap.xml.dom.Document");
Xap.require("xap.xml.dom.events.StructureChangeEvent");
Xap.require("xap.xml.dom.XapElement");
Xap.require("xap.xml.InvalidXmlException");
Xap.require("google.dom");
Xap.require("xap.util.ArrayHelper");
xap.xml.dom.Document=function(_291){
google.XDocument.call(this);
this._rootElement=_291;
this._structureChangeListeners=[];
this._attributeChangeListeners=[];
this._idToElementMap={};
this._prefixToNamespaceMap={};
};
xap.xml.dom.Document.prototype=new google.XDocument();
xap.xml.dom.Document.XML_DECL_WITHOUT_ENC="<?xml version=\"1.0\"?>";
xap.xml.dom.Document.prototype.createElement=function(_292,ns,_294){
if(!_292){
throw new xap.xml.InvalidXmlException(xap.xml.InvalidXmlException.NULL_LOCALNAME_MSGID,["xap.xml.dom.Document.createElement"]);
}
var e=new xap.xml.dom.XapElement(_292,null,null,null);
e._setNamespaceUri(ns?ns:"");
e._setPrefix(_294);
return e;
};
xap.xml.dom.Document.prototype.getRootElement=function(){
return this._rootElement;
};
xap.xml.dom.Document.prototype.addAttributeChangeListener=function(_296){
this._attributeChangeListeners.push(_296);
};
xap.xml.dom.Document.prototype.removeAttributeChangeListener=function(_297){
return xap.util.ArrayHelper.removeElement(this._attributeChangeListeners,_297);
};
xap.xml.dom.Document.prototype.addStructureChangeListener=function(_298){
this._structureChangeListeners.push(_298);
};
xap.xml.dom.Document.prototype.removeStructureChangeListener=function(_299){
return xap.util.ArrayHelper.removeElement(this._structureChangeListeners,_299);
};
xap.xml.dom.Document.prototype.getElementById=function(id){
return this._idToElementMap[id];
};
xap.xml.dom.Document.prototype.setRootElement=function(root){
if(!root&&!this._rootElement){
return;
}
this._removeExistingRoot();
if(root){
var _29c=new xap.xml.dom.events.StructureChangeEvent(null,root);
this._notifyListenersOfStructureChange(this._structureChangeListeners,_29c,"beforeChildAdded");
this._rootElement=_29c.getChange();
if(this._rootElement.getParent()){
this._rootElement.getParent().removeChild(this._rootElement);
}else{
if(this._rootElement.ownerDocument&&this._rootElement.ownerDocument.getRootElement()==this._rootElement){
this._rootElement.ownerDocument.setRootElement(null);
}
}
this.appendChild(this._rootElement);
this._addDocumentFragmentToIdMapAndCheckForPrefixCollisions(this._rootElement);
this._notifyListenersOfStructureChange(this._structureChangeListeners,_29c,"onChildAdded");
}else{
this._rootElement=null;
}
};
xap.xml.dom.Document.prototype.toXml=function(_29d){
return this._toStringHelper(_29d,true);
};
xap.xml.dom.Document.prototype.toXmlWithoutAutoAssignedIds=function(_29e){
return this._toStringHelper(_29e,false);
};
xap.xml.dom.Document.prototype.toString=function(){
return this._toStringHelper(true,false);
};
xap.xml.dom.Document.prototype._addDocumentFragmentToIdMapAndCheckForPrefixCollisions=function(e){
e.ownerDocument=this;
this._addIdToElementMapping(e.getAttribute("id"),e);
this._checkPrefixForCollisionAndRegister(e);
e._notifyListenersOnAddedToDocument(this);
for(var i=0;i<e.childNodes.length;i++){
var o=e.childNodes[i];
if(o.nodeType==google.DOM_ELEMENT_NODE){
this._addDocumentFragmentToIdMapAndCheckForPrefixCollisions(o);
}
}
};
xap.xml.dom.Document.prototype._removeDocumentFragmentFromIdMap=function(e){
delete e.ownerDocument;
delete (this._idToElementMap[e.getAttribute("id")]);
e._notifyListenersOnRemovedFromDocument(this);
for(var i=0;i<e.childNodes.length;i++){
var o=e.childNodes[i];
if(o.nodeType==google.DOM_ELEMENT_NODE){
this._removeDocumentFragmentFromIdMap(o);
}
}
};
xap.xml.dom.Document.prototype._removeExistingRoot=function(){
if(this._rootElement){
var _2a5=new xap.xml.dom.events.StructureChangeEvent(null,this._rootElement);
this._notifyListenersOfStructureChange(this._structureChangeListeners,"beforeChildRemoved");
this.removeChild(this._rootElement);
this._removeDocumentFragmentFromIdMap(this._rootElement);
this._notifyListenersOfStructureChange(this._structureChangeListeners,_2a5,"onChildRemoved");
}
};
xap.xml.dom.Document.prototype._notifyListenersOfStructureChange=function(_2a6,_2a7,_2a8){
if(_2a6){
for(var i=0;i<_2a6.length;i++){
var _2aa=_2a6[i];
if(_2aa[_2a8]){
_2aa[_2a8].call(_2aa,_2a7);
if(_2a6[i]!=_2aa){
i=i-1;
}
}
}
}
};
xap.xml.dom.Document.prototype._addIdToElementMapping=function(id,_2ac){
if(this._idToElementMap[id]){
throw new xap.xml.InvalidXmlException(xap.xml.InvalidXmlException.ID_CONFLICT_MSGID,[id,_2ac.toXml(),this._idToElementMap[id].toXml()]);
}
this._idToElementMap[id]=_2ac;
};
xap.xml.dom.Document.prototype._checkPrefixForCollisionAndRegister=function(_2ad){
if(!_2ad.getPrefix()){
return;
}
if(this._prefixToNamespaceMap[_2ad.getPrefix()]){
var _2ae=this._prefixToNamespaceMap[_2ad.getPrefix()];
var _2af=_2ad.getNamespaceUri();
if(_2ae!=_2af){
throw new xap.xml.InvalidXmlException(xap.xml.InvalidXmlException.PREFIX_CONFLICT_MSGID,[_2ad.getPrefix(),_2ae,_2ad.getPrefix(),_2af]);
}
}else{
this._prefixToNamespaceMap[_2ad.getPrefix()]=_2ad.getNamespaceUri();
}
};
xap.xml.dom.Document.prototype._toStringHelper=function(_2b0,_2b1){
var _2b2="";
if(this._rootElement){
if(_2b1){
_2b2=this._rootElement.toXml(_2b0);
}else{
_2b2=this._rootElement.toXmlWithoutAutoAssignedIds(_2b0);
}
}
var sbuf=xap.xml.dom.Document.XML_DECL_WITHOUT_ENC;
if(_2b0){
sbuf+="\n";
}
sbuf+=_2b2;
return sbuf;
};
Xap.provide("xap.session.Container");
Xap.require("xap.util.Hashtable");
xap.session.Container=function(_2b4){
this._clientSession=_2b4;
this._namesToObjects=new xap.util.Hashtable();
this._objectsToNames=new xap.util.Hashtable();
};
xap.session.Container.UNNAMED=new Object();
xap.session.Container.prototype.getSession=function(){
return this._clientSession;
};
xap.session.Container.prototype.get=function(name){
return this._namesToObjects.get(name);
};
xap.session.Container.prototype.put=function(name,obj){
var _2b8=null;
if(name!=null){
_2b8=this.remove(name);
this._namesToObjects.put(name,obj);
this._objectsToNames.put(obj,name);
}else{
this._objectsToNames.put(obj,xap.session.Container.UNNAMED);
}
if(obj.addedToContainer){
obj.addedToContainer(this,name);
}
var self=this;
if(!obj.getSession){
obj.getSession=function(){
return self._clientSession;
};
}
return _2b8;
};
xap.session.Container.prototype.getName=function(obj){
var name=this._objectsToNames.get(obj);
if(name==xap.session.Container.UNNAMED){
name=null;
}
return name;
};
xap.session.Container.prototype.getNames=function(){
return this._namesToObjects.keys();
};
xap.session.Container.prototype.containsValue=function(obj){
return this._objectsToNames.containsKey(obj);
};
xap.session.Container.prototype.removeValue=function(obj){
var name=this._objectsToNames.remove(obj);
if(name!=null){
if(name!=xap.session.Container.UNNAMED){
this._namesToObjects.remove(name);
}
if(obj.removedFromContainer){
obj.removedFromContainer(this,name==xap.session.Container.UNNAMED?null:name);
}
}else{
return false;
}
return true;
};
xap.session.Container.prototype.remove=function(name){
var obj=null;
if(name!=null){
obj=this._namesToObjects.get(name);
if(obj!=null){
this._namesToObjects.remove(name);
this._objectsToNames.remove(obj);
if(obj.removedFromContainer){
obj.removedFromContainer(this,name);
}
}
}
return obj;
};
xap.session.Container.prototype.getObjects=function(){
return this._objectsToNames.keys();
};
xap.session.Container.prototype.size=function(){
return this._objectsToNames.size();
};
xap.session.Container.prototype.destroy=function(){
var mcos=getObjects();
for(var i=0;i<mcos.length;i++){
removeValue(mcos[i]);
}
};
Xap.provide("xap.xml.DocumentContainer");
Xap.require("xap.xml.dom.Document");
Xap.require("xap.session.Container");
xap.xml.DocumentContainer=function(_2c3){
xap.session.Container.call(this,_2c3);
for(var i=0;i<xap.xml.DocumentContainer.RESERVED_DOCUMENT_NAMES.length;i++){
var doc=new xap.xml.dom.Document(null);
var root=doc.createElement(xap.xml.DocumentContainer.RESERVED_DOCUMENT_NAMES[i]);
doc.setRootElement(root);
this.put(xap.xml.DocumentContainer.RESERVED_DOCUMENT_NAMES[i],doc);
}
};
xap.xml.DocumentContainer.prototype=new xap.session.Container;
xap.xml.DocumentContainer.UI_DOCUMENT_NAME="ui";
xap.xml.DocumentContainer.RESERVED_DOCUMENT_NAMES=[xap.xml.DocumentContainer.UI_DOCUMENT_NAME];
xap.xml.DocumentContainer.prototype.getUiDocument=function(){
return this.get(xap.xml.DocumentContainer.UI_DOCUMENT_NAME);
};
Xap.require("google.misc");
Xap.require("google.dom");
Xap.provide("google.xpath");
with(google){
google.xpathParse=function(expr){
if(xpathdebug){
Log.write("XPath parse "+expr);
}
xpathParseInit();
var _2c8=xpathCacheLookup(expr);
if(_2c8){
if(xpathdebug){
Log.write(" ... cached");
}
return _2c8;
}
if(expr.match(/^(\$|@)?\w+$/i)){
var ret=makeSimpleExpr(expr);
xpathParseCache[expr]=ret;
if(xpathdebug){
Log.write(" ... simple");
}
return ret;
}
if(expr.match(/^\w+(\/\w+)*$/i)){
var ret=makeSimpleExpr2(expr);
xpathParseCache[expr]=ret;
if(xpathdebug){
Log.write(" ... simple 2");
}
return ret;
}
var _2ca=expr;
var _2cb=[];
var _2cc=null;
var _2cd=null;
var done=false;
var _2cf=0;
var _2d0=0;
var _2d1=0;
while(!done){
_2cf++;
expr=expr.replace(/^\s*/,"");
_2cd=_2cc;
_2cc=null;
var rule=null;
var _2d3="";
for(var i=0;i<xpathTokenRules.length;++i){
var _2d5=xpathTokenRules[i].re.exec(expr);
_2d0++;
if(_2d5&&_2d5.length>0&&_2d5[0].length>_2d3.length){
rule=xpathTokenRules[i];
_2d3=_2d5[0];
break;
}
}
if(rule&&(rule==TOK_DIV||rule==TOK_MOD||rule==TOK_AND||rule==TOK_OR)&&(!_2cd||_2cd.tag==TOK_AT||_2cd.tag==TOK_DSLASH||_2cd.tag==TOK_SLASH||_2cd.tag==TOK_AXIS||_2cd.tag==TOK_DOLLAR)){
rule=TOK_QNAME;
}
if(rule){
expr=expr.substr(_2d3.length);
if(xpathdebug){
Log.write("token: "+_2d3+" -- "+rule.label);
}
_2cc={tag:rule,match:_2d3,prec:rule.prec?rule.prec:0,expr:makeTokenExpr(_2d3)};
}else{
if(xpathdebug){
Log.write("DONE");
}
done=true;
}
while(xpathReduce(_2cb,_2cc)){
_2d1++;
if(xpathdebug){
Log.write("stack: "+stackToString(_2cb));
}
}
}
if(xpathdebug){
Log.write(stackToString(_2cb));
}
if(_2cb.length!=1){
throw "XPath parse error "+_2ca+":\n"+stackToString(_2cb);
}
var _2d5=_2cb[0].expr;
xpathParseCache[_2ca]=_2d5;
if(xpathdebug){
Log.write("XPath parse: "+_2cf+" / "+_2d0+" / "+_2d1);
}
return _2d5;
};
xpathParseCache={};
google.xpathCacheLookup=function(expr){
return xpathParseCache[expr];
};
google.xpathReduce=function(_2d7,_2d8){
var cand=null;
if(_2d7.length>0){
var top=_2d7[_2d7.length-1];
var _2db=xpathRules[top.tag.key];
if(_2db){
for(var i=0;i<_2db.length;++i){
var rule=_2db[i];
var _2de=xpathMatchStack(_2d7,rule[1]);
if(_2de.length){
cand={tag:rule[0],rule:rule,match:_2de};
cand.prec=xpathGrammarPrecedence(cand);
break;
}
}
}
}
var ret;
if(cand&&(!_2d8||cand.prec>_2d8.prec||(_2d8.tag.left&&cand.prec>=_2d8.prec))){
for(var i=0;i<cand.match.matchlength;++i){
_2d7.pop();
}
if(xpathdebug){
Log.write("reduce "+cand.tag.label+" "+cand.prec+" ahead "+(_2d8?_2d8.tag.label+" "+_2d8.prec+(_2d8.tag.left?" left":""):" none "));
}
var _2e0=mapExpr(cand.match,function(m){
return m.expr;
});
cand.expr=cand.rule[3].apply(null,_2e0);
_2d7.push(cand);
ret=true;
}else{
if(_2d8){
if(xpathdebug){
Log.write("shift "+_2d8.tag.label+" "+_2d8.prec+(_2d8.tag.left?" left":"")+" over "+(cand?cand.tag.label+" "+cand.prec:" none"));
}
_2d7.push(_2d8);
}
ret=false;
}
return ret;
};
google.xpathMatchStack=function(_2e2,_2e3){
var S=_2e2.length;
var P=_2e3.length;
var p,s;
var _2e7=[];
_2e7.matchlength=0;
var ds=0;
for(p=P-1,s=S-1;p>=0&&s>=0;--p,s-=ds){
ds=0;
var _2e9=[];
if(_2e3[p]==Q_MM){
p-=1;
_2e7.push(_2e9);
while(s-ds>=0&&_2e2[s-ds].tag==_2e3[p]){
_2e9.push(_2e2[s-ds]);
ds+=1;
_2e7.matchlength+=1;
}
}else{
if(_2e3[p]==Q_01){
p-=1;
_2e7.push(_2e9);
while(s-ds>=0&&ds<2&&_2e2[s-ds].tag==_2e3[p]){
_2e9.push(_2e2[s-ds]);
ds+=1;
_2e7.matchlength+=1;
}
}else{
if(_2e3[p]==Q_1M){
p-=1;
_2e7.push(_2e9);
if(_2e2[s].tag==_2e3[p]){
while(s-ds>=0&&_2e2[s-ds].tag==_2e3[p]){
_2e9.push(_2e2[s-ds]);
ds+=1;
_2e7.matchlength+=1;
}
}else{
return [];
}
}else{
if(_2e2[s].tag==_2e3[p]){
_2e7.push(_2e2[s]);
ds+=1;
_2e7.matchlength+=1;
}else{
return [];
}
}
}
}
reverseInplace(_2e9);
_2e9.expr=mapExpr(_2e9,function(m){
return m.expr;
});
}
reverseInplace(_2e7);
if(p==-1){
return _2e7;
}else{
return [];
}
};
google.xpathTokenPrecedence=function(tag){
return tag.prec||2;
};
google.xpathGrammarPrecedence=function(_2ec){
var ret=0;
if(_2ec.rule){
if(_2ec.rule.length>=3&&_2ec.rule[2]>=0){
ret=_2ec.rule[2];
}else{
for(var i=0;i<_2ec.rule[1].length;++i){
var p=xpathTokenPrecedence(_2ec.rule[1][i]);
ret=Math.max(ret,p);
}
}
}else{
if(_2ec.tag){
ret=xpathTokenPrecedence(_2ec.tag);
}else{
if(_2ec.length){
for(var j=0;j<_2ec.length;++j){
var p=xpathGrammarPrecedence(_2ec[j]);
ret=Math.max(ret,p);
}
}
}
}
return ret;
};
google.stackToString=function(_2f1){
var ret="";
for(var i=0;i<_2f1.length;++i){
if(ret){
ret+="\n";
}
ret+=_2f1[i].tag.label;
}
return ret;
};
google.ExprContext=function(node,_2f5,_2f6,_2f7){
this.node=node;
this.position=_2f5||0;
this.nodelist=_2f6||[node];
this.variables={};
this.parent=_2f7||null;
this.root=_2f7?_2f7.root:(node.ownerDocument?node.ownerDocument:node);
};
ExprContext.prototype.clone=function(node,_2f9,_2fa){
return new ExprContext(node||this.node,typeof _2f9!="undefined"?_2f9:this.position,_2fa||this.nodelist,this);
};
ExprContext.prototype.setVariable=function(name,_2fc){
this.variables[name]=_2fc;
};
ExprContext.prototype.getVariable=function(name){
if(typeof this.variables[name]!="undefined"){
return this.variables[name];
}else{
if(this.parent){
return this.parent.getVariable(name);
}else{
return null;
}
}
};
ExprContext.prototype.setNode=function(node,_2ff){
this.node=node;
this.position=_2ff;
};
google.StringValue=function(_300){
this.value=_300;
this.type="string";
};
StringValue.prototype.stringValue=function(){
return this.value;
};
StringValue.prototype.booleanValue=function(){
return this.value.length>0;
};
StringValue.prototype.numberValue=function(){
return this.value-0;
};
StringValue.prototype.nodeSetValue=function(){
throw this+" "+Error().stack;
};
google.BooleanValue=function(_301){
this.value=_301;
this.type="boolean";
};
BooleanValue.prototype.stringValue=function(){
return ""+this.value;
};
BooleanValue.prototype.booleanValue=function(){
return this.value;
};
BooleanValue.prototype.numberValue=function(){
return this.value?1:0;
};
BooleanValue.prototype.nodeSetValue=function(){
throw this+" "+Error().stack;
};
google.NumberValue=function(_302){
this.value=_302;
this.type="number";
};
NumberValue.prototype.stringValue=function(){
return ""+this.value;
};
NumberValue.prototype.booleanValue=function(){
return !!this.value;
};
NumberValue.prototype.numberValue=function(){
return this.value-0;
};
NumberValue.prototype.nodeSetValue=function(){
throw this+" "+Error().stack;
};
google.NodeSetValue=function(_303){
this.value=_303;
this.type="node-set";
};
NodeSetValue.prototype.stringValue=function(){
if(this.value.length==0){
return "";
}else{
return xmlValue(this.value[0]);
}
};
NodeSetValue.prototype.booleanValue=function(){
return this.value.length>0;
};
NodeSetValue.prototype.numberValue=function(){
return this.stringValue()-0;
};
NodeSetValue.prototype.nodeSetValue=function(){
return this.value;
};
google.TokenExpr=function(m){
this.value=m;
};
TokenExpr.prototype.evaluate=function(){
return new StringValue(this.value);
};
google.LocationExpr=function(){
this.absolute=false;
this.steps=[];
};
LocationExpr.prototype.appendStep=function(s){
this.steps.push(s);
};
LocationExpr.prototype.prependStep=function(s){
var _307=this.steps;
this.steps=[s];
for(var i=0;i<_307.length;++i){
this.steps.push(_307[i]);
}
};
LocationExpr.prototype.evaluate=function(ctx){
var _30a;
if(this.absolute){
_30a=ctx.root;
}else{
_30a=ctx.node;
}
var _30b=[];
xPathStep(_30b,this.steps,0,_30a,ctx);
return new NodeSetValue(_30b);
};
google.xPathStep=function(_30c,_30d,step,_30f,ctx){
var s=_30d[step];
var ctx2=ctx.clone(_30f);
var _313=s.evaluate(ctx2).nodeSetValue();
for(var i=0;i<_313.length;++i){
if(step==_30d.length-1){
_30c.push(_313[i]);
}else{
xPathStep(_30c,_30d,step+1,_313[i],ctx);
}
}
};
google.StepExpr=function(axis,_316,_317){
this.axis=axis;
this.nodetest=_316;
this.predicate=_317||[];
};
StepExpr.prototype.appendPredicate=function(p){
this.predicate.push(p);
};
StepExpr.prototype.evaluate=function(ctx){
var _31a=ctx.node;
var _31b=[];
if(this.axis==xpathAxis.ANCESTOR_OR_SELF){
_31b.push(_31a);
for(var n=_31a.parentNode;n;n=_31a.parentNode){
_31b.push(n);
}
}else{
if(this.axis==xpathAxis.ANCESTOR){
for(var n=_31a.parentNode;n;n=_31a.parentNode){
_31b.push(n);
}
}else{
if(this.axis==xpathAxis.ATTRIBUTE){
copyArray(_31b,_31a.attributes);
}else{
if(this.axis==xpathAxis.CHILD){
copyArray(_31b,_31a.childNodes);
}else{
if(this.axis==xpathAxis.DESCENDANT_OR_SELF){
_31b.push(_31a);
xpathCollectDescendants(_31b,_31a);
}else{
if(this.axis==xpathAxis.DESCENDANT){
xpathCollectDescendants(_31b,_31a);
}else{
if(this.axis==xpathAxis.FOLLOWING){
for(var n=_31a.parentNode;n;n=n.parentNode){
for(var nn=n.nextSibling;nn;nn=nn.nextSibling){
_31b.push(nn);
xpathCollectDescendants(_31b,nn);
}
}
}else{
if(this.axis==xpathAxis.FOLLOWING_SIBLING){
for(var n=_31a.nextSibling;n;n=_31a.nextSibling){
_31b.push(n);
}
}else{
if(this.axis==xpathAxis.NAMESPACE){
alert("not implemented: axis namespace");
}else{
if(this.axis==xpathAxis.PARENT){
if(_31a.parentNode){
_31b.push(_31a.parentNode);
}
}else{
if(this.axis==xpathAxis.PRECEDING){
for(var n=_31a.parentNode;n;n=n.parentNode){
for(var nn=n.previousSibling;nn;nn=nn.previousSibling){
_31b.push(nn);
xpathCollectDescendantsReverse(_31b,nn);
}
}
}else{
if(this.axis==xpathAxis.PRECEDING_SIBLING){
for(var n=_31a.previousSibling;n;n=_31a.previousSibling){
_31b.push(n);
}
}else{
if(this.axis==xpathAxis.SELF){
_31b.push(_31a);
}else{
throw "ERROR -- NO SUCH AXIS: "+this.axis;
}
}
}
}
}
}
}
}
}
}
}
}
}
var _31e=_31b;
_31b=[];
for(var i=0;i<_31e.length;++i){
var n=_31e[i];
if(this.nodetest.evaluate(ctx.clone(n,i,_31e)).booleanValue()){
_31b.push(n);
}
}
for(var i=0;i<this.predicate.length;++i){
var _31e=_31b;
_31b=[];
for(var ii=0;ii<_31e.length;++ii){
var n=_31e[ii];
if(this.predicate[i].evaluate(ctx.clone(n,ii,_31e)).booleanValue()){
_31b.push(n);
}
}
}
return new NodeSetValue(_31b);
};
google.NodeTestAny=function(){
this.value=new BooleanValue(true);
};
NodeTestAny.prototype.evaluate=function(ctx){
return this.value;
};
google.NodeTestElement=function(){
};
NodeTestElement.prototype.evaluate=function(ctx){
return new BooleanValue(ctx.node.nodeType==DOM_ELEMENT_NODE);
};
google.NodeTestText=function(){
};
NodeTestText.prototype.evaluate=function(ctx){
return new BooleanValue(ctx.node.nodeType==DOM_TEXT_NODE);
};
google.NodeTestComment=function(){
};
NodeTestComment.prototype.evaluate=function(ctx){
return new BooleanValue(ctx.node.nodeType==DOM_COMMENT_NODE);
};
google.NodeTestPI=function(_325){
this.target=_325;
};
NodeTestPI.prototype.evaluate=function(ctx){
return new BooleanValue(ctx.node.nodeType==DOM_PROCESSING_INSTRUCTION_NODE&&(!this.target||ctx.node.nodeName==this.target));
};
google.NodeTestNC=function(_327){
this.regex=new RegExp("^"+_327+":");
this.nsprefix=_327;
};
NodeTestNC.prototype.evaluate=function(ctx){
var n=ctx.node;
return new BooleanValue(this.regex.match(n.nodeName));
};
google.NodeTestName=function(name){
this.name=name;
};
NodeTestName.prototype.evaluate=function(ctx){
var n=ctx.node;
return new BooleanValue(n.nodeName==this.name);
};
google.PredicateExpr=function(expr){
this.expr=expr;
};
PredicateExpr.prototype.evaluate=function(ctx){
var v=this.expr.evaluate(ctx);
if(v.type=="number"){
return new BooleanValue(ctx.position==v.numberValue()-1);
}else{
return new BooleanValue(v.booleanValue());
}
};
google.FunctionCallExpr=function(name){
this.name=name;
this.args=[];
};
FunctionCallExpr.prototype.appendArg=function(arg){
this.args.push(arg);
};
FunctionCallExpr.prototype.evaluate=function(ctx){
var fn=""+this.name.value;
var f=this.xpathfunctions[fn];
if(f){
return f.call(this,ctx);
}else{
Log.write("XPath NO SUCH FUNCTION "+fn);
return new BooleanValue(false);
}
};
FunctionCallExpr.prototype.xpathfunctions={"last":function(ctx){
assert(this.args.length==0);
return new NumberValue(ctx.nodelist.length);
},"position":function(ctx){
assert(this.args.length==0);
return new NumberValue(ctx.position+1);
},"count":function(ctx){
assert(this.args.length==1);
var v=this.args[0].evaluate(ctx);
return new NumberValue(v.nodeSetValue().length);
},"id":function(ctx){
assert(this.args.length==1);
var e=this.args[0].evaluate(ctx);
var ret=[];
var ids;
if(e.type=="node-set"){
ids=[];
for(var i=0;i<e.length;++i){
var v=xmlValue(e[i]).split(/\s+/);
for(var ii=0;ii<v.length;++ii){
ids.push(v[ii]);
}
}
}else{
ids=e.stringValue().split(/\s+/);
}
var d=ctx.node.ownerDocument;
if(!d&&ctx.node.getElementById){
d=ctx.node;
}
for(var i=0;i<ids.length;++i){
var n=d.getElementById(ids[i]);
if(n){
ret.push(n);
}
}
return new NodeSetValue(ret);
},"local-name":function(ctx){
alert("not implmented yet: XPath function local-name()");
},"namespace-uri":function(ctx){
alert("not implmented yet: XPath function namespace-uri()");
},"name":function(ctx){
assert(this.args.length==1||this.args.length==0);
var n;
if(this.args.length==0){
n=[ctx.node];
}else{
n=this.args[0].evaluate(ctx).nodeSetValue();
}
if(n.length==0){
return new StringValue("");
}else{
return new StringValue(n[0].nodeName);
}
},"string":function(ctx){
assert(this.args.length==1||this.args.length==0);
if(this.args.length==0){
return new StringValue(new NodeSetValue([ctx.node]).stringValue());
}else{
return new StringValue(this.args[0].evaluate(ctx).stringValue());
}
},"concat":function(ctx){
var ret="";
for(var i=0;i<this.args.length;++i){
ret+=this.args[i].evaluate(ctx).stringValue();
}
return new StringValue(ret);
},"starts-with":function(ctx){
assert(this.args.length==2);
var s0=this.args[0].evaluate(ctx).stringValue();
var s1=this.args[1].evaluate(ctx).stringValue();
return new BooleanValue(s0.indexOf(s1)==0);
},"contains":function(ctx){
assert(this.args.length==2);
var s0=this.args[0].evaluate(ctx).stringValue();
var s1=this.args[1].evaluate(ctx).stringValue();
return new BooleanValue(s0.indexOf(s1)!=-1);
},"substring-before":function(ctx){
assert(this.args.length==2);
var s0=this.args[0].evaluate(ctx).stringValue();
var s1=this.args[1].evaluate(ctx).stringValue();
var i=s0.indexOf(s1);
var ret;
if(i==-1){
ret="";
}else{
ret=s0.substr(0,i);
}
return new StringValue(ret);
},"substring-after":function(ctx){
assert(this.args.length==2);
var s0=this.args[0].evaluate(ctx).stringValue();
var s1=this.args[1].evaluate(ctx).stringValue();
var i=s0.indexOf(s1);
var ret;
if(i==-1){
ret="";
}else{
ret=s0.substr(i+s1.length);
}
return new StringValue(ret);
},"substring":function(ctx){
assert(this.args.length==2||this.args.length==3);
var s0=this.args[0].evaluate(ctx).stringValue();
var s1=this.args[1].evaluate(ctx).numberValue();
var ret;
if(this.args.length==2){
var i1=Math.max(0,Math.round(s1)-1);
ret=s0.substr(i1);
}else{
var s2=this.args[2].evaluate(ctx).numberValue();
var i0=Math.round(s1)-1;
var i1=Math.max(0,i0);
var i2=Math.round(s2)-Math.max(0,-i0);
ret=s0.substr(i1,i2);
}
return new StringValue(ret);
},"string-length":function(ctx){
var s;
if(this.args.length>0){
s=this.args[0].evaluate(ctx).stringValue();
}else{
s=new NodeSetValue([ctx.node]).stringValue();
}
return new NumberValue(s.length);
},"normalize-space":function(ctx){
var s;
if(this.args.length>0){
s=this.args[0].evaluate(ctx).stringValue();
}else{
s=new NodeSetValue([ctx.node]).stringValue();
}
s=s.replace(/^\s*/,"").replace(/\s*$/,"").replace(/\s+/g," ");
return new StringValue(s);
},"translate":function(ctx){
assert(this.args.length==3);
var s0=this.args[0].evaluate(ctx).stringValue();
var s1=this.args[1].evaluate(ctx).stringValue();
var s2=this.args[2].evaluate(ctx).stringValue();
for(var i=0;i<s1.length;++i){
s0=s0.replace(new RegExp(s1.charAt(i),"g"),s2.charAt(i));
}
return new StringValue(s0);
},"boolean":function(ctx){
assert(this.args.length==1);
return new BooleanValue(this.args[0].evaluate(ctx).booleanValue());
},"not":function(ctx){
assert(this.args.length==1);
var ret=!this.args[0].evaluate(ctx).booleanValue();
return new BooleanValue(ret);
},"true":function(ctx){
assert(this.args.length==0);
return new BooleanValue(true);
},"false":function(ctx){
assert(this.args.length==0);
return new BooleanValue(false);
},"lang":function(ctx){
assert(this.args.length==1);
var lang=this.args[0].evaluate(ctx).stringValue();
var _372;
var n=ctx.node;
while(n&&n!=n.parentNode){
_372=n.getAttribute("xml:lang");
if(_372){
break;
}
n=n.parentNode;
}
if(!_372){
return new BooleanValue(false);
}else{
var re=new RegExp("^"+lang+"$","i");
return new BooleanValue(_372.match(re)||_372.replace(/_.*$/,"").match(re));
}
},"number":function(ctx){
assert(this.args.length==1||this.args.length==0);
if(this.args.length==1){
return new NumberValue(this.args[0].evaluate(ctx).numberValue());
}else{
return new NumberValue(new NodeSetValue([ctx.node]).numberValue());
}
},"sum":function(ctx){
assert(this.args.length==1);
var n=this.args[0].evaluate(ctx).nodeSetValue();
var sum=0;
for(var i=0;i<n.length;++i){
sum+=xmlValue(n[i])-0;
}
return new NumberValue(sum);
},"floor":function(ctx){
assert(this.args.length==1);
var num=this.args[0].evaluate(ctx).numberValue();
return new NumberValue(Math.floor(num));
},"ceiling":function(ctx){
assert(this.args.length==1);
var num=this.args[0].evaluate(ctx).numberValue();
return new NumberValue(Math.ceil(num));
},"round":function(ctx){
assert(this.args.length==1);
var num=this.args[0].evaluate(ctx).numberValue();
return new NumberValue(Math.round(num));
},"ext-join":function(ctx){
assert(this.args.length==2);
var _381=this.args[0].evaluate(ctx).nodeSetValue();
var _382=this.args[1].evaluate(ctx).stringValue();
var ret="";
for(var i=0;i<_381.length;++i){
if(ret){
ret+=_382;
}
ret+=xmlValue(_381[i]);
}
return new StringValue(ret);
},"ext-if":function(ctx){
assert(this.args.length==3);
if(this.args[0].evaluate(ctx).booleanValue()){
return this.args[1].evaluate(ctx);
}else{
return this.args[2].evaluate(ctx);
}
},"ext-sprintf":function(ctx){
assert(this.args.length>=1);
var args=[];
for(var i=0;i<this.args.length;++i){
args.push(this.args[i].evaluate(ctx).stringValue());
}
return new StringValue(sprintf.apply(null,args));
},"ext-cardinal":function(ctx){
assert(this.args.length>=1);
var c=this.args[0].evaluate(ctx).numberValue();
var ret=[];
for(var i=0;i<c;++i){
ret.push(ctx.node);
}
return new NodeSetValue(ret);
}};
google.UnionExpr=function(_38d,_38e){
this.expr1=_38d;
this.expr2=_38e;
};
UnionExpr.prototype.evaluate=function(ctx){
var _390=this.expr1.evaluate(ctx).nodeSetValue();
var _391=this.expr2.evaluate(ctx).nodeSetValue();
var I1=_390.length;
for(var i2=0;i2<_391.length;++i2){
for(var i1=0;i1<I1;++i1){
if(_390[i1]==_391[i2]){
i1=I1;
}
}
_390.push(_391[i2]);
}
return new NodeSetValue(_391);
};
google.PathExpr=function(_395,rel){
this.filter=_395;
this.rel=rel;
};
PathExpr.prototype.evaluate=function(ctx){
var _398=this.filter.evaluate(ctx).nodeSetValue();
var _399=[];
for(var i=0;i<_398.length;++i){
var _39b=this.rel.evaluate(ctx.clone(_398[i],i,_398)).nodeSetValue();
for(var ii=0;ii<_39b.length;++ii){
_399.push(_39b[ii]);
}
}
return new NodeSetValue(_399);
};
google.FilterExpr=function(expr,_39e){
this.expr=expr;
this.predicate=_39e;
};
FilterExpr.prototype.evaluate=function(ctx){
var _3a0=this.expr.evaluate(ctx).nodeSetValue();
for(var i=0;i<this.predicate.length;++i){
var _3a2=_3a0;
_3a0=[];
for(var j=0;j<_3a2.length;++j){
var n=_3a2[j];
if(this.predicate[i].evaluate(ctx.clone(n,j,_3a2)).booleanValue()){
_3a0.push(n);
}
}
}
return new NodeSetValue(_3a0);
};
google.UnaryMinusExpr=function(expr){
this.expr=expr;
};
UnaryMinusExpr.prototype.evaluate=function(ctx){
return new NumberValue(-this.expr.evaluate(ctx).numberValue());
};
google.BinaryExpr=function(_3a7,op,_3a9){
this.expr1=_3a7;
this.expr2=_3a9;
this.op=op;
};
BinaryExpr.prototype.evaluate=function(ctx){
var ret;
switch(this.op.value){
case "or":
ret=new BooleanValue(this.expr1.evaluate(ctx).booleanValue()||this.expr2.evaluate(ctx).booleanValue());
break;
case "and":
ret=new BooleanValue(this.expr1.evaluate(ctx).booleanValue()&&this.expr2.evaluate(ctx).booleanValue());
break;
case "+":
ret=new NumberValue(this.expr1.evaluate(ctx).numberValue()+this.expr2.evaluate(ctx).numberValue());
break;
case "-":
ret=new NumberValue(this.expr1.evaluate(ctx).numberValue()-this.expr2.evaluate(ctx).numberValue());
break;
case "*":
ret=new NumberValue(this.expr1.evaluate(ctx).numberValue()*this.expr2.evaluate(ctx).numberValue());
break;
case "mod":
ret=new NumberValue(this.expr1.evaluate(ctx).numberValue()%this.expr2.evaluate(ctx).numberValue());
break;
case "div":
ret=new NumberValue(this.expr1.evaluate(ctx).numberValue()/this.expr2.evaluate(ctx).numberValue());
break;
case "=":
ret=this.compare(ctx,function(x1,x2){
return x1==x2;
});
break;
case "!=":
ret=this.compare(ctx,function(x1,x2){
return x1!=x2;
});
break;
case "<":
ret=this.compare(ctx,function(x1,x2){
return x1<x2;
});
break;
case "<=":
ret=this.compare(ctx,function(x1,x2){
return x1<=x2;
});
break;
case ">":
ret=this.compare(ctx,function(x1,x2){
return x1>x2;
});
break;
case ">=":
ret=this.compare(ctx,function(x1,x2){
return x1>=x2;
});
break;
default:
alert("BinaryExpr.evaluate: "+this.op.value);
}
return ret;
};
BinaryExpr.prototype.compare=function(ctx,cmp){
var v1=this.expr1.evaluate(ctx);
var v2=this.expr2.evaluate(ctx);
var ret;
if(v1.type=="node-set"&&v2.type=="node-set"){
var n1=v1.nodeSetValue();
var n2=v2.nodeSetValue();
ret=false;
for(var i1=0;i1<n1.length;++i1){
for(var i2=0;i2<n2.length;++i2){
if(cmp(xmlValue(n1[i1]),xmlValue(n2[i2]))){
ret=true;
i2=n2.length;
i1=n1.length;
}
}
}
}else{
if(v1.type=="node-set"||v2.type=="node-set"){
if(v1.type=="number"){
var s=v1.numberValue();
var n=v2.nodeSetValue();
ret=false;
for(var i=0;i<n.length;++i){
var nn=xmlValue(n[i])-0;
if(cmp(s,nn)){
ret=true;
break;
}
}
}else{
if(v2.type=="number"){
var n=v1.nodeSetValue();
var s=v2.numberValue();
ret=false;
for(var i=0;i<n.length;++i){
var nn=xmlValue(n[i])-0;
if(cmp(nn,s)){
ret=true;
break;
}
}
}else{
if(v1.type=="string"){
var s=v1.stringValue();
var n=v2.nodeSetValue();
ret=false;
for(var i=0;i<n.length;++i){
var nn=xmlValue(n[i]);
if(cmp(s,nn)){
ret=true;
break;
}
}
}else{
if(v2.type=="string"){
var n=v1.nodeSetValue();
var s=v2.stringValue();
ret=false;
for(var i=0;i<n.length;++i){
var nn=xmlValue(n[i]);
if(cmp(nn,s)){
ret=true;
break;
}
}
}else{
ret=cmp(v1.booleanValue(),v2.booleanValue());
}
}
}
}
}else{
if(v1.type=="boolean"||v2.type=="boolean"){
ret=cmp(v1.booleanValue(),v2.booleanValue());
}else{
if(v1.type=="number"||v2.type=="number"){
ret=cmp(v1.numberValue(),v2.numberValue());
}else{
ret=cmp(v1.stringValue(),v2.stringValue());
}
}
}
}
return new BooleanValue(ret);
};
google.LiteralExpr=function(_3c5){
this.value=_3c5;
};
LiteralExpr.prototype.evaluate=function(ctx){
return new StringValue(this.value);
};
google.NumberExpr=function(_3c7){
this.value=_3c7;
};
NumberExpr.prototype.evaluate=function(ctx){
return new NumberValue(this.value);
};
google.VariableExpr=function(name){
this.name=name;
};
VariableExpr.prototype.evaluate=function(ctx){
return ctx.getVariable(this.name);
};
google.makeTokenExpr=function(m){
return new TokenExpr(m);
};
google.passExpr=function(e){
return e;
};
google.makeLocationExpr1=function(_3cd,rel){
rel.absolute=true;
return rel;
};
google.makeLocationExpr2=function(_3cf,rel){
rel.absolute=true;
rel.prependStep(makeAbbrevStep(_3cf.value));
return rel;
};
google.makeLocationExpr3=function(_3d1){
var ret=new LocationExpr();
ret.appendStep(makeAbbrevStep("."));
ret.absolute=true;
return ret;
};
google.makeLocationExpr4=function(_3d3){
var ret=new LocationExpr();
ret.absolute=true;
ret.appendStep(makeAbbrevStep(_3d3.value));
return ret;
};
google.makeLocationExpr5=function(step){
var ret=new LocationExpr();
ret.appendStep(step);
return ret;
};
google.makeLocationExpr6=function(rel,_3d8,step){
rel.appendStep(step);
return rel;
};
google.makeLocationExpr7=function(rel,_3db,step){
rel.appendStep(makeAbbrevStep(_3db.value));
return rel;
};
google.makeStepExpr1=function(dot){
return makeAbbrevStep(dot.value);
};
google.makeStepExpr2=function(ddot){
return makeAbbrevStep(ddot.value);
};
google.makeStepExpr3=function(_3df,axis,_3e1){
return new StepExpr(_3df.value,_3e1);
};
google.makeStepExpr4=function(at,_3e3){
return new StepExpr("attribute",_3e3);
};
google.makeStepExpr5=function(_3e4){
return new StepExpr("child",_3e4);
};
google.makeStepExpr6=function(step,_3e6){
step.appendPredicate(_3e6);
return step;
};
google.makeAbbrevStep=function(_3e7){
switch(_3e7){
case "//":
return new StepExpr("descendant-or-self",new NodeTestAny);
case ".":
return new StepExpr("self",new NodeTestAny);
case "..":
return new StepExpr("parent",new NodeTestAny);
}
};
google.makeNodeTestExpr1=function(_3e8){
return new NodeTestElement;
};
google.makeNodeTestExpr2=function(_3e9,_3ea,_3eb){
return new NodeTestNC(_3e9.value);
};
google.makeNodeTestExpr3=function(_3ec){
return new NodeTestName(_3ec.value);
};
google.makeNodeTestExpr4=function(_3ed,_3ee){
var type=_3ed.value.replace(/\s*\($/,"");
switch(type){
case "node":
return new NodeTestAny;
case "text":
return new NodeTestText;
case "comment":
return new NodeTestComment;
case "processing-instruction":
return new NodeTestPI;
}
};
google.makeNodeTestExpr5=function(_3f0,_3f1,_3f2){
var type=_3f0.replace(/\s*\($/,"");
if(type!="processing-instruction"){
throw type+" "+Error().stack;
}
return new NodeTestPI(_3f1.value);
};
google.makePredicateExpr=function(_3f4,expr,_3f6){
return new PredicateExpr(expr);
};
google.makePrimaryExpr=function(_3f7,expr,_3f9){
return expr;
};
google.makeFunctionCallExpr1=function(name,_3fb,_3fc){
return new FunctionCallExpr(name);
};
google.makeFunctionCallExpr2=function(name,_3fe,arg1,args,_401){
var ret=new FunctionCallExpr(name);
ret.appendArg(arg1);
for(var i=0;i<args.length;++i){
ret.appendArg(args[i]);
}
return ret;
};
google.makeArgumentExpr=function(_404,expr){
return expr;
};
google.makeUnionExpr=function(_406,pipe,_408){
return new UnionExpr(_406,_408);
};
google.makePathExpr1=function(_409,_40a,rel){
return new PathExpr(_409,rel);
};
google.makePathExpr2=function(_40c,_40d,rel){
rel.prependStep(makeAbbrevStep(_40d.value));
return new PathExpr(_40c,rel);
};
google.makeFilterExpr=function(expr,_410){
if(_410.length>0){
return new FilterExpr(expr,_410);
}else{
return expr;
}
};
google.makeUnaryMinusExpr=function(_411,expr){
return new UnaryMinusExpr(expr);
};
google.makeBinaryExpr=function(_413,op,_415){
return new BinaryExpr(_413,op,_415);
};
google.makeLiteralExpr=function(_416){
var _417=_416.value.substring(1,_416.value.length-1);
return new LiteralExpr(_417);
};
google.makeNumberExpr=function(_418){
return new NumberExpr(_418.value);
};
google.makeVariableReference=function(_419,name){
return new VariableExpr(name.value);
};
google.makeSimpleExpr=function(expr){
if(expr.charAt(0)=="$"){
return new VariableExpr(expr.substr(1));
}else{
if(expr.charAt(0)=="@"){
var a=new NodeTestName(expr.substr(1));
var b=new StepExpr("attribute",a);
var c=new LocationExpr();
c.appendStep(b);
return c;
}else{
if(expr.match(/^[0-9]+$/)){
return new NumberExpr(expr);
}else{
var a=new NodeTestName(expr);
var b=new StepExpr("child",a);
var c=new LocationExpr();
c.appendStep(b);
return c;
}
}
}
};
google.makeSimpleExpr2=function(expr){
var _420=expr.split("/");
var c=new LocationExpr();
for(var i=0;i<_420.length;i++){
var a=new NodeTestName(_420[i]);
var b=new StepExpr("child",a);
c.appendStep(b);
}
return c;
};
google.xpathAxis={ANCESTOR_OR_SELF:"ancestor-or-self",ANCESTOR:"ancestor",ATTRIBUTE:"attribute",CHILD:"child",DESCENDANT_OR_SELF:"descendant-or-self",DESCENDANT:"descendant",FOLLOWING_SIBLING:"following-sibling",FOLLOWING:"following",NAMESPACE:"namespace",PARENT:"parent",PRECEDING_SIBLING:"preceding-sibling",PRECEDING:"preceding",SELF:"self"};
google.xpathAxesRe=[xpathAxis.ANCESTOR_OR_SELF,xpathAxis.ANCESTOR,xpathAxis.ATTRIBUTE,xpathAxis.CHILD,xpathAxis.DESCENDANT_OR_SELF,xpathAxis.DESCENDANT,xpathAxis.FOLLOWING_SIBLING,xpathAxis.FOLLOWING,xpathAxis.NAMESPACE,xpathAxis.PARENT,xpathAxis.PRECEDING_SIBLING,xpathAxis.PRECEDING,xpathAxis.SELF].join("|");
google.TOK_PIPE={label:"|",prec:17,re:new RegExp("^\\|")};
google.TOK_DSLASH={label:"//",prec:19,re:new RegExp("^//")};
google.TOK_SLASH={label:"/",prec:30,re:new RegExp("^/")};
google.TOK_AXIS={label:"::",prec:20,re:new RegExp("^::")};
google.TOK_COLON={label:":",prec:1000,re:new RegExp("^:")};
google.TOK_AXISNAME={label:"[axis]",re:new RegExp("^("+xpathAxesRe+")")};
google.TOK_PARENO={label:"(",prec:34,re:new RegExp("^\\(")};
google.TOK_PARENC={label:")",re:new RegExp("^\\)")};
google.TOK_DDOT={label:"..",prec:34,re:new RegExp("^\\.\\.")};
google.TOK_DOT={label:".",prec:34,re:new RegExp("^\\.")};
google.TOK_AT={label:"@",prec:34,re:new RegExp("^@")};
google.TOK_COMMA={label:",",re:new RegExp("^,")};
google.TOK_OR={label:"or",prec:10,re:new RegExp("^or\\b")};
google.TOK_AND={label:"and",prec:11,re:new RegExp("^and\\b")};
google.TOK_EQ={label:"=",prec:12,re:new RegExp("^=")};
google.TOK_NEQ={label:"!=",prec:12,re:new RegExp("^!=")};
google.TOK_GE={label:">=",prec:13,re:new RegExp("^>=")};
google.TOK_GT={label:">",prec:13,re:new RegExp("^>")};
google.TOK_LE={label:"<=",prec:13,re:new RegExp("^<=")};
google.TOK_LT={label:"<",prec:13,re:new RegExp("^<")};
google.TOK_PLUS={label:"+",prec:14,re:new RegExp("^\\+"),left:true};
google.TOK_MINUS={label:"-",prec:14,re:new RegExp("^\\-"),left:true};
google.TOK_DIV={label:"div",prec:15,re:new RegExp("^div\\b"),left:true};
google.TOK_MOD={label:"mod",prec:15,re:new RegExp("^mod\\b"),left:true};
google.TOK_BRACKO={label:"[",prec:32,re:new RegExp("^\\[")};
google.TOK_BRACKC={label:"]",re:new RegExp("^\\]")};
google.TOK_DOLLAR={label:"$",re:new RegExp("^\\$")};
google.TOK_NCNAME={label:"[ncname]",re:new RegExp("^[a-z][-\\w]*","i")};
google.TOK_ASTERISK={label:"*",prec:15,re:new RegExp("^\\*"),left:true};
google.TOK_LITERALQ={label:"[litq]",prec:20,re:new RegExp("^'[^\\']*'")};
google.TOK_LITERALQQ={label:"[litqq]",prec:20,re:new RegExp("^\"[^\\\"]*\"")};
google.TOK_NUMBER={label:"[number]",prec:35,re:new RegExp("^\\d+(\\.\\d*)?")};
google.TOK_QNAME={label:"[qname]",re:new RegExp("^([a-z][-\\w]*:)?[a-z][-\\w]*","i")};
google.TOK_NODEO={label:"[nodetest-start]",re:new RegExp("^(processing-instruction|comment|text|node)\\(")};
google.xpathTokenRules=[TOK_DSLASH,TOK_SLASH,TOK_DDOT,TOK_DOT,TOK_AXIS,TOK_COLON,TOK_AXISNAME,TOK_NODEO,TOK_PARENO,TOK_PARENC,TOK_BRACKO,TOK_BRACKC,TOK_AT,TOK_COMMA,TOK_OR,TOK_AND,TOK_NEQ,TOK_EQ,TOK_GE,TOK_GT,TOK_LE,TOK_LT,TOK_PLUS,TOK_MINUS,TOK_ASTERISK,TOK_PIPE,TOK_MOD,TOK_DIV,TOK_LITERALQ,TOK_LITERALQQ,TOK_NUMBER,TOK_QNAME,TOK_NCNAME,TOK_DOLLAR];
google.XPathLocationPath={label:"LocationPath"};
google.XPathRelativeLocationPath={label:"RelativeLocationPath"};
google.XPathAbsoluteLocationPath={label:"AbsoluteLocationPath"};
google.XPathStep={label:"Step"};
google.XPathNodeTest={label:"NodeTest"};
google.XPathPredicate={label:"Predicate"};
google.XPathLiteral={label:"Literal"};
google.XPathExpr={label:"Expr"};
google.XPathPrimaryExpr={label:"PrimaryExpr"};
google.XPathVariableReference={label:"Variablereference"};
google.XPathNumber={label:"Number"};
google.XPathFunctionCall={label:"FunctionCall"};
google.XPathArgumentRemainder={label:"ArgumentRemainder"};
google.XPathPathExpr={label:"PathExpr"};
google.XPathUnionExpr={label:"UnionExpr"};
google.XPathFilterExpr={label:"FilterExpr"};
google.XPathDigits={label:"Digits"};
google.xpathNonTerminals=[XPathLocationPath,XPathRelativeLocationPath,XPathAbsoluteLocationPath,XPathStep,XPathNodeTest,XPathPredicate,XPathLiteral,XPathExpr,XPathPrimaryExpr,XPathVariableReference,XPathNumber,XPathFunctionCall,XPathArgumentRemainder,XPathPathExpr,XPathUnionExpr,XPathFilterExpr,XPathDigits];
google.Q_01={label:"?"};
google.Q_MM={label:"*"};
google.Q_1M={label:"+"};
google.ASSOC_LEFT=true;
google.xpathGrammarRules=[[XPathLocationPath,[XPathRelativeLocationPath],18,passExpr],[XPathLocationPath,[XPathAbsoluteLocationPath],18,passExpr],[XPathAbsoluteLocationPath,[TOK_SLASH,XPathRelativeLocationPath],18,makeLocationExpr1],[XPathAbsoluteLocationPath,[TOK_DSLASH,XPathRelativeLocationPath],18,makeLocationExpr2],[XPathAbsoluteLocationPath,[TOK_SLASH],0,makeLocationExpr3],[XPathAbsoluteLocationPath,[TOK_DSLASH],0,makeLocationExpr4],[XPathRelativeLocationPath,[XPathStep],31,makeLocationExpr5],[XPathRelativeLocationPath,[XPathRelativeLocationPath,TOK_SLASH,XPathStep],31,makeLocationExpr6],[XPathRelativeLocationPath,[XPathRelativeLocationPath,TOK_DSLASH,XPathStep],31,makeLocationExpr7],[XPathStep,[TOK_DOT],33,makeStepExpr1],[XPathStep,[TOK_DDOT],33,makeStepExpr2],[XPathStep,[TOK_AXISNAME,TOK_AXIS,XPathNodeTest],33,makeStepExpr3],[XPathStep,[TOK_AT,XPathNodeTest],33,makeStepExpr4],[XPathStep,[XPathNodeTest],33,makeStepExpr5],[XPathStep,[XPathStep,XPathPredicate],33,makeStepExpr6],[XPathNodeTest,[TOK_ASTERISK],33,makeNodeTestExpr1],[XPathNodeTest,[TOK_NCNAME,TOK_COLON,TOK_ASTERISK],33,makeNodeTestExpr2],[XPathNodeTest,[TOK_QNAME],33,makeNodeTestExpr3],[XPathNodeTest,[TOK_NODEO,TOK_PARENC],33,makeNodeTestExpr4],[XPathNodeTest,[TOK_NODEO,XPathLiteral,TOK_PARENC],33,makeNodeTestExpr5],[XPathPredicate,[TOK_BRACKO,XPathExpr,TOK_BRACKC],33,makePredicateExpr],[XPathPrimaryExpr,[XPathVariableReference],33,passExpr],[XPathPrimaryExpr,[TOK_PARENO,XPathExpr,TOK_PARENC],33,makePrimaryExpr],[XPathPrimaryExpr,[XPathLiteral],30,passExpr],[XPathPrimaryExpr,[XPathNumber],30,passExpr],[XPathPrimaryExpr,[XPathFunctionCall],30,passExpr],[XPathFunctionCall,[TOK_QNAME,TOK_PARENO,TOK_PARENC],-1,makeFunctionCallExpr1],[XPathFunctionCall,[TOK_QNAME,TOK_PARENO,XPathExpr,XPathArgumentRemainder,Q_MM,TOK_PARENC],-1,makeFunctionCallExpr2],[XPathArgumentRemainder,[TOK_COMMA,XPathExpr],-1,makeArgumentExpr],[XPathUnionExpr,[XPathPathExpr],20,passExpr],[XPathUnionExpr,[XPathUnionExpr,TOK_PIPE,XPathPathExpr],20,makeUnionExpr],[XPathPathExpr,[XPathLocationPath],20,passExpr],[XPathPathExpr,[XPathFilterExpr],19,passExpr],[XPathPathExpr,[XPathFilterExpr,TOK_SLASH,XPathRelativeLocationPath],20,makePathExpr1],[XPathPathExpr,[XPathFilterExpr,TOK_DSLASH,XPathRelativeLocationPath],20,makePathExpr2],[XPathPathExpr,[XPathFunctionCall,TOK_SLASH,XPathRelativeLocationPath],20,makePathExpr1],[XPathPathExpr,[XPathFunctionCall,TOK_DSLASH,XPathRelativeLocationPath],20,makePathExpr2],[XPathFilterExpr,[XPathPrimaryExpr,XPathPredicate,Q_MM],20,makeFilterExpr],[XPathExpr,[XPathPrimaryExpr],16,passExpr],[XPathExpr,[XPathUnionExpr],16,passExpr],[XPathExpr,[TOK_MINUS,XPathExpr],-1,makeUnaryMinusExpr],[XPathExpr,[XPathExpr,TOK_OR,XPathExpr],-1,makeBinaryExpr],[XPathExpr,[XPathExpr,TOK_AND,XPathExpr],-1,makeBinaryExpr],[XPathExpr,[XPathExpr,TOK_EQ,XPathExpr],-1,makeBinaryExpr],[XPathExpr,[XPathExpr,TOK_NEQ,XPathExpr],-1,makeBinaryExpr],[XPathExpr,[XPathExpr,TOK_LT,XPathExpr],-1,makeBinaryExpr],[XPathExpr,[XPathExpr,TOK_LE,XPathExpr],-1,makeBinaryExpr],[XPathExpr,[XPathExpr,TOK_GT,XPathExpr],-1,makeBinaryExpr],[XPathExpr,[XPathExpr,TOK_GE,XPathExpr],-1,makeBinaryExpr],[XPathExpr,[XPathExpr,TOK_PLUS,XPathExpr],-1,makeBinaryExpr,ASSOC_LEFT],[XPathExpr,[XPathExpr,TOK_MINUS,XPathExpr],-1,makeBinaryExpr,ASSOC_LEFT],[XPathExpr,[XPathExpr,TOK_ASTERISK,XPathExpr],-1,makeBinaryExpr,ASSOC_LEFT],[XPathExpr,[XPathExpr,TOK_DIV,XPathExpr],-1,makeBinaryExpr,ASSOC_LEFT],[XPathExpr,[XPathExpr,TOK_MOD,XPathExpr],-1,makeBinaryExpr,ASSOC_LEFT],[XPathLiteral,[TOK_LITERALQ],-1,makeLiteralExpr],[XPathLiteral,[TOK_LITERALQQ],-1,makeLiteralExpr],[XPathNumber,[TOK_NUMBER],-1,makeNumberExpr],[XPathVariableReference,[TOK_DOLLAR,TOK_QNAME],200,makeVariableReference]];
google.xpathRules=[];
google.xpathParseInit=function(){
if(xpathRules.length){
return;
}
xpathGrammarRules.sort(function(a,b){
var la=a[1].length;
var lb=b[1].length;
if(la<lb){
return 1;
}else{
if(la>lb){
return -1;
}else{
return 0;
}
}
});
var k=1;
for(var i=0;i<xpathNonTerminals.length;++i){
xpathNonTerminals[i].key=k++;
}
for(i=0;i<xpathTokenRules.length;++i){
xpathTokenRules[i].key=k++;
}
Log.write("XPath parse INIT: "+k+" rules");
function push_(_42b,_42c,_42d){
if(!_42b[_42c]){
_42b[_42c]=[];
}
_42b[_42c].push(_42d);
}
for(i=0;i<xpathGrammarRules.length;++i){
var rule=xpathGrammarRules[i];
var _42f=rule[1];
for(var j=_42f.length-1;j>=0;--j){
if(_42f[j]==Q_1M){
push_(xpathRules,_42f[j-1].key,rule);
break;
}else{
if(_42f[j]==Q_MM||_42f[j]==Q_01){
push_(xpathRules,_42f[j-1].key,rule);
--j;
}else{
push_(xpathRules,_42f[j].key,rule);
break;
}
}
}
}
Log.write("XPath parse INIT: "+xpathRules.length+" rule bins");
var sum=0;
mapExec(xpathRules,function(i){
if(i){
sum+=i.length;
}
});
Log.write("XPath parse INIT: "+(sum/xpathRules.length)+" average bin size");
};
google.xpathCollectDescendants=function(_433,node){
for(var n=node.firstChild;n;n=n.nextSibling){
_433.push(n);
arguments.callee(_433,n);
}
};
google.xpathCollectDescendantsReverse=function(_436,node){
for(var n=node.lastChild;n;n=n.previousSibling){
_436.push(n);
arguments.callee(_436,n);
}
};
google.xpathDomEval=function(expr,node){
var _43b=xpathParse(expr);
var ret=_43b.evaluate(new ExprContext(node));
return ret;
};
google.xpathSort=function(_43d,sort){
if(sort.length==0){
return;
}
var _43f=[];
for(var i=0;i<_43d.nodelist.length;++i){
var node=_43d.nodelist[i];
var _442={node:node,key:[]};
var _443=_43d.clone(node,0,[node]);
for(var j=0;j<sort.length;++j){
var s=sort[j];
var _446=s.expr.evaluate(_443);
var _447;
if(s.type=="text"){
_447=_446.stringValue();
}else{
if(s.type=="number"){
_447=_446.numberValue();
}
}
_442.key.push({value:_447,order:s.order});
}
_442.key.push({value:i,order:"ascending"});
_43f.push(_442);
}
_43f.sort(xpathSortByKey);
var _448=[];
for(var i=0;i<_43f.length;++i){
_448.push(_43f[i].node);
}
_43d.nodelist=_448;
_43d.setNode(_448[0],0);
};
google.xpathSortByKey=function(v1,v2){
for(var i=0;i<v1.key.length;++i){
var o=v1.key[i].order=="descending"?-1:1;
if(v1.key[i].value>v2.key[i].value){
return +1*o;
}else{
if(v1.key[i].value<v2.key[i].value){
return -1*o;
}
}
}
return 0;
};
}
Xap.provide("xap.xml.sax.SaxContentHandler");
Xap.require("xap.xml.dom.Document");
Xap.require("xap.util.Hashtable");
Xap.require("xap.util.Character");
xap.xml.sax.SaxContentHandler=function(){
this._root=null;
this._currentParent=null;
this._document=null;
this._currentElement=new Array();
this._prefixToNamespace=new xap.util.Hashtable();
this._namespaceStackFrames=new Array();
};
xap.xml.sax.SaxContentHandler.prototype.startDocument=function(){
this._document=new xap.xml.dom.Document(null);
};
xap.xml.sax.SaxContentHandler.prototype.endDocument=function(){
this._document.setRootElement(this._root);
};
xap.xml.sax.SaxContentHandler.prototype.getDocument=function(){
return this._document;
};
xap.xml.sax.SaxContentHandler.prototype.startElement=function(name,_44e,_44f){
var _450=this._processNamespaceDeclarations(_44e);
if(_450!=null){
this._namespaceStackFrames.push(_450);
}
var _451=null;
var _452=null;
var j=name.indexOf(":",0);
if(j!=-1){
_451=name.substring(0,j);
name=name.substring(j+1,name.length);
}
if(_451!=null){
_452=this._getNamespaceForPrefix(_451);
}else{
_452=this._getDefaultNamespace();
}
var el=this._document.createElement(name,_452,_451);
if(_44f){
el.baseUrl=_44f;
}
if(_450!=null){
_450._element=el;
}
this._currentElement.push(el);
var id=_44e["id"];
if(id!=null&&id!=""){
el.setAttribute("id",id);
}
if(this._root==null){
this._root=el;
}
if(this._currentParent!=null){
this._currentParent.appendChild(el);
}
this._currentParent=el;
for(var attr in _44e){
el.setAttribute(attr,_44e[attr]);
}
};
xap.xml.sax.SaxContentHandler.prototype.endElement=function(name){
if(this._currentParent!=null){
this._currentParent=this._currentParent.getParent();
}
var _458=this._currentElement.pop();
var _459=this._namespaceStackFrames.length;
if(_459>0&&this._namespaceStackFrames[_459-1]._element==_458){
this._namespaceStackFrames.pop();
}
};
xap.xml.sax.SaxContentHandler.prototype.characters=function(data){
if(this._currentParent!=null){
if(!xap.util.Character.isWhiteSpace(data)){
var _45b=this._document.createTextNode(data);
this._currentParent.appendChild(_45b);
}
}
};
xap.xml.sax.SaxContentHandler.prototype._getDefaultNamespace=function(){
for(var i=this._namespaceStackFrames.length-1;i>=0;i--){
if(this._namespaceStackFrames[i]._defaultNamespace!=null){
return this._namespaceStackFrames[i]._defaultNamespace;
}
}
return null;
};
xap.xml.sax.SaxContentHandler.prototype._getNamespaceForPrefix=function(_45d){
for(var i=this._namespaceStackFrames.length-1;i>=0;i--){
if(this._namespaceStackFrames[i]._prefixToNamespaces&&this._namespaceStackFrames[i]._prefixToNamespaces[_45d]!=null){
return this._namespaceStackFrames[i]._prefixToNamespaces[_45d];
}
}
return null;
};
xap.xml.sax.SaxContentHandler.prototype._processNamespaceDeclarations=function(_45f){
var _460=null;
for(var attr in _45f){
if(attr.indexOf("xmlns")==0){
if(_460==null){
_460=new xap.xml.sax.SaxContentHandler.NamespaceStackFrame();
}
if(attr=="xmlns"){
_460.setDefaultNamespace(_45f[attr]);
}else{
var _462=attr.substring(attr.indexOf(":")+1);
_460.addNamespacePrefix(_462,_45f[attr]);
}
}
}
return _460;
};
xap.xml.sax.SaxContentHandler.prototype._parsePrefix=function(name){
var _464=null;
var j=name.indexOf(":",0);
if(j!=-1){
_464=name.substring(0,j);
}
return _464;
};
xap.xml.sax.SaxContentHandler.NamespaceStackFrame=function(){
this._defaultNamespace=null;
this._prefixToNamespaces=null;
};
xap.xml.sax.SaxContentHandler.NamespaceStackFrame.prototype.setDefaultNamespace=function(_466){
this._defaultNamespace=_466;
};
xap.xml.sax.SaxContentHandler.NamespaceStackFrame.prototype.addNamespacePrefix=function(_467,_468){
if(!this._prefixToNamespaces){
this._prefixToNamespaces=new Object();
}
this._prefixToNamespaces[_467]=_468;
};
xap.xml.sax.SaxContentHandler.NamespaceStackFrame.prototype.toString=function(){
var _469="Default namespace:"+this._defaultNamespace+"\n";
if(this._prefixToNamespaces){
for(var i in this._prefixToNamespaces){
_469+=i+":"+this._prefixToNamespaces[i]+"\n";
}
}
return _469;
};
Xap.provide("xap.xml.sax.SaxParser");
Xap.require("xap.xml.sax.ParserException");
Xap.require("xap.util.Hashtable");
Xap.require("xap.util.Character");
xap.xml.sax.SaxParser=function(_46b){
this.doc=false;
this.handler=_46b;
this._cursor=-1;
this._data=null;
this._parseModeStack=new Array(xap.xml.sax.SaxParser.START_DOCUMENT);
this._setParseMode(xap.xml.sax.SaxParser.START_DOCUMENT);
this._documentEnded=false;
this._inContent=false;
this._atEndOfLine=false;
this._currentLine=-1;
this._currentColumn=-1;
};
xap.xml.sax.SaxParser.NO_NAMESPACE=18;
xap.xml.sax.SaxParser.START_DOCUMENT=0;
xap.xml.sax.SaxParser.END_DOCUMENT=1;
xap.xml.sax.SaxParser.START_TAG=2;
xap.xml.sax.SaxParser.END_TAG=3;
xap.xml.sax.SaxParser.TEXT=4;
xap.xml.sax.SaxParser.CDSECT=5;
xap.xml.sax.SaxParser.ENTITY_REF=6;
xap.xml.sax.SaxParser.IGNORABLE_WHITESPACE=7;
xap.xml.sax.SaxParser.PROCESSING_INSTRUCTION=8;
xap.xml.sax.SaxParser.COMMENT=9;
xap.xml.sax.SaxParser.DOCDECL=10;
xap.xml.sax.SaxParser.OPEN_TAG=11;
xap.xml.sax.SaxParser.IN_TAG=12;
xap.xml.sax.SaxParser.SELF_CONTAINED_TAG=13;
xap.xml.sax.SaxParser.IN_ATTR_KEY=14;
xap.xml.sax.SaxParser.AT_ATTR_EQUALS_SIGN=15;
xap.xml.sax.SaxParser.IN_ATTR_VALUE=16;
xap.xml.sax.SaxParser.QUOTE=17;
xap.xml.sax.SaxParser._parseModeStrings=new Array(0);
xap.xml.sax.SaxParser._parseModeStrings[xap.xml.sax.SaxParser.NO_NAMESPACE]="NO_NAMESPACE";
xap.xml.sax.SaxParser._parseModeStrings[xap.xml.sax.SaxParser.START_DOCUMENT]="START_DOCUMENT";
xap.xml.sax.SaxParser._parseModeStrings[xap.xml.sax.SaxParser.END_DOCUMENT]="END_DOCUMENT";
xap.xml.sax.SaxParser._parseModeStrings[xap.xml.sax.SaxParser.START_TAG]="START_TAG";
xap.xml.sax.SaxParser._parseModeStrings[xap.xml.sax.SaxParser.END_TAG]="END_TAG";
xap.xml.sax.SaxParser._parseModeStrings[xap.xml.sax.SaxParser.TEXT]="TEXT";
xap.xml.sax.SaxParser._parseModeStrings[xap.xml.sax.SaxParser.CDSECT]="CDSECT";
xap.xml.sax.SaxParser._parseModeStrings[xap.xml.sax.SaxParser.ENTITY_REF]="ENTITY_REF";
xap.xml.sax.SaxParser._parseModeStrings[xap.xml.sax.SaxParser.IGNORABLE_WHITESPACE]="IGNORABLE_WHITESPACE";
xap.xml.sax.SaxParser._parseModeStrings[xap.xml.sax.SaxParser.PROCESSING_INSTRUCTION]="PROCESSING_INSTRUCTION";
xap.xml.sax.SaxParser._parseModeStrings[xap.xml.sax.SaxParser.COMMENT]="COMMENT";
xap.xml.sax.SaxParser._parseModeStrings[xap.xml.sax.SaxParser.DOCDECL]="DOCDECL";
xap.xml.sax.SaxParser._parseModeStrings[xap.xml.sax.SaxParser.OPEN_TAG]="OPEN_TAG";
xap.xml.sax.SaxParser._parseModeStrings[xap.xml.sax.SaxParser.IN_TAG]="IN_TAG";
xap.xml.sax.SaxParser._parseModeStrings[xap.xml.sax.SaxParser.SELF_CONTAINED_TAG]="SELF_CONTAINED_TAG";
xap.xml.sax.SaxParser._parseModeStrings[xap.xml.sax.SaxParser.IN_ATTR_KEY]="IN_ATTR_KEY";
xap.xml.sax.SaxParser._parseModeStrings[xap.xml.sax.SaxParser.AT_ATTR_EQUALS_SIGN]="AT_ATTR_EQUALS_SIGN";
xap.xml.sax.SaxParser._parseModeStrings[xap.xml.sax.SaxParser.IN_ATTR_VALUE]="IN_ATTR_VALUE";
xap.xml.sax.SaxParser._parseModeStrings[xap.xml.sax.SaxParser.QUOTE]="QUOTE";
xap.xml.sax.SaxParser._entityMap=new Object();
xap.xml.sax.SaxParser._entityMap["amp"]="&";
xap.xml.sax.SaxParser._entityMap["apos"]="'";
xap.xml.sax.SaxParser._entityMap["gt"]=">";
xap.xml.sax.SaxParser._entityMap["lt"]="<";
xap.xml.sax.SaxParser._entityMap["quot"]="\"";
xap.xml.sax.SaxParser.prototype.setDocumentHandler=function(_46c){
this.handler=_46c;
};
xap.xml.sax.SaxParser.prototype._getParseMode=function(){
return this._parseMode;
};
xap.xml.sax.SaxParser.prototype._setParseMode=function(_46d){
this._parseMode=_46d;
};
xap.xml.sax.SaxParser.prototype.getDocumentHandler=function(){
return this.handler;
};
xap.xml.sax.SaxParser.prototype._startDocument=function(){
this.handler.startDocument();
};
xap.xml.sax.SaxParser.prototype._endDocument=function(){
this.handler.endDocument();
};
xap.xml.sax.SaxParser.prototype._startElement=function(_46e,_46f,_470){
this.handler.startElement(_46e,_46f,_470);
};
xap.xml.sax.SaxParser.prototype._endElement=function(_471,_472){
this.handler.endElement(_471,_472);
};
xap.xml.sax.SaxParser.prototype._characters=function(text){
this.handler.characters(text);
};
xap.xml.sax.SaxParser.prototype._logString="";
xap.xml.sax.SaxParser.prototype._printStack=function(){
var _474="";
_474+="\n";
_474+="\nSTACK:"+this._parseModeStack.length;
_474+="\n========";
var j=-1;
for(j in this._parseModeStack){
_474+="\n"+xap.xml.sax.SaxParser._parseModeStrings[this._parseModeStack[j]];
}
_474+="\n--------------";
_474+="\n"+xap.xml.sax.SaxParser._parseModeStrings[this._getParseMode()];
return _474;
};
xap.xml.sax.SaxParser.prototype._logStack=function(){
this._logString+=this._printStack();
};
xap.xml.sax.SaxParser.prototype.parse=function(_476,_477){
this._data=_476;
if(this.handler==null){
this._throwParserException(xap.xml.sax.ParserException.DOCUMENT_HANDLER_MISSING,[]);
}
var _478=0;
var _479=0;
var _47a="\"";
var _47b="";
var _47c="";
var _47d=null;
var _47e=null;
var _47f=null;
var _480=null;
this._startDocument();
this._cursor=-1;
while(_476.length>++this._cursor){
if(this._documentEnded){
this._throwParserException(xap.xml.sax.ParserException.ONLY_ONE_ROOT_ELEMENT_PER_DOC,[]);
}
var _481=_479;
_479=_476.charAt(this._cursor);
this._currentLine=1;
this._currentColumn=0;
this._atEndOfLine=false;
if(_479=="\n"&&this._atEndOfLine){
this._atEndOfLine=false;
continue;
}else{
if(this._atEndOfLine){
this._atEndOfLine=false;
}else{
if(_479=="\n"){
++this._currentLine;
this._currentColumn=0;
}else{
if(_479=="\r"){
this._atEndOfLine=true;
_479="\n";
++this._currentLine;
this._currentColumn=0;
}else{
++this._currentColumn;
}
}
}
}
if(this._getParseMode()==xap.xml.sax.SaxParser.END_DOCUMENT){
this._endDocument();
return this.handler.getDocument();
}else{
if(this._getParseMode()==xap.xml.sax.SaxParser.TEXT){
if(_479=="<"){
this._parseModeStack.push(this._getParseMode());
this._setParseMode(xap.xml.sax.SaxParser.START_TAG);
if(_47b.length>0){
this._characters(_47b);
_47b="";
}
}else{
if(_479=="&"){
this._parseModeStack.push(this._getParseMode());
this._setParseMode(xap.xml.sax.SaxParser.ENTITY_REF);
_47c="";
}else{
_47b+=_479;
}
}
}else{
if(this._getParseMode()==xap.xml.sax.SaxParser.END_TAG){
if(_479==">"){
this._setParseMode(this._parseModeStack.pop());
_47e=_47b;
_47b="";
_478--;
if(_478==0){
this._setParseMode(xap.xml.sax.SaxParser.END_DOCUMENT);
}
this._endElement(_47e);
}else{
_47b+=_479;
}
}else{
if(this._getParseMode()==xap.xml.sax.SaxParser.CDSECT){
if(_479==">"&&xap.xml.sax.SaxParser._endsWith(_47b,"]]")){
_47b=_47b.substring(0,_47b.length-2);
this._characters(_47b);
_47b="";
this._setParseMode(this._parseModeStack.pop());
}else{
_47b+=_479;
}
}else{
if(this._getParseMode()==xap.xml.sax.SaxParser.COMMENT){
if(_479==">"&&xap.xml.sax.SaxParser._endsWith(_47b,"--")){
if(xap.xml.sax.SaxParser._endsWith(_47b,"---")){
this._throwParserException(xap.xml.sax.ParserException.ILLEGAL_COMMENT_DELIMITER,[],null);
}else{
_47b="";
this._setParseMode(this._parseModeStack.pop());
}
}else{
_47b+=_479;
}
}else{
if(this._getParseMode()==xap.xml.sax.SaxParser.START_DOCUMENT){
if(_479=="<"){
this._setParseMode(xap.xml.sax.SaxParser.TEXT);
this._parseModeStack.push(this._getParseMode());
this._setParseMode(xap.xml.sax.SaxParser.START_TAG);
}
}else{
if(this._getParseMode()==xap.xml.sax.SaxParser.DOCDECL){
if(_479==">"){
this._setParseMode(xap.xml.sax.SaxParser.START_DOCUMENT);
}
}else{
if(this._getParseMode()==xap.xml.sax.SaxParser.PROCESSING_INSTRUCTION){
if(_479==">"){
if(_481=="?"){
this._setParseMode(xap.xml.sax.SaxParser.START_DOCUMENT);
}else{
this._throwParserException(xap.xml.sax.ParserException.UNEXPECTED_END_TAG,["?>",""+_481+">"],null);
}
}
}else{
if(this._getParseMode()==xap.xml.sax.SaxParser.START_TAG){
this._setParseMode(this._parseModeStack.pop());
if(_479=="/"){
this._parseModeStack.push(this._getParseMode());
this._setParseMode(xap.xml.sax.SaxParser.END_TAG);
}else{
if(_479=="?"){
this._setParseMode(xap.xml.sax.SaxParser.PROCESSING_INSTRUCTION);
}else{
this._parseModeStack.push(this._getParseMode());
this._setParseMode(xap.xml.sax.SaxParser.OPEN_TAG);
_47e=null;
_47d=new Object();
_47b+=_479;
}
}
}else{
if(this._getParseMode()==xap.xml.sax.SaxParser.ENTITY_REF){
if(_479==";"){
this._setParseMode(this._parseModeStack.pop());
var _482=_47c;
_47c="";
var _483=xap.xml.sax.SaxParser._entityMap[_482];
if(_483!=null){
_47b+=_483;
}else{
if(_482.charAt(0)=="#"){
var _484=xap.xml.sax.SaxParser._validateNumericEntity(_482);
if(!_484){
var typ="decimal";
var _486=xap.xml.sax.SaxParser._excludeDecimalRegexp;
if(_482.substring(1)=="x"){
typ="hexidecimal";
_486=xap.xml.sax.SaxParser._excludeHexRegexp;
}
var _487=_482.substring(2).match(_486);
this._throwParserException(xap.xml.sax.ParserException.UNDEFINED_ENTITY,[("[&"+_482+";] "+": "+_487+((_487.length==1)?" is not a legal character ":" are not legal characters ")+" for a "+typ+" numeric entity code.")]);
}
_47b+="&"+_482+";";
}else{
this._throwParserException(xap.xml.sax.ParserException.UNDEFINED_ENTITY,["[&"+_482+";]"]);
}
}
}else{
_47c+=_479;
}
}else{
if(this._getParseMode()==xap.xml.sax.SaxParser.SELF_CONTAINED_TAG){
if(_47e==null){
_47e=_47b;
}
if(_479!=">"){
this._throwParserException(xap.xml.sax.ParserException.UNEXPECTED_END_TAG,[">",_479]);
}
this._startElement(_47e,_47d,_477);
this._endElement(_47e);
if(_478==0){
this._endDocument();
return this.handler.getDocument();
}
_47b="";
_47d=new Object();
_47e=null;
this._setParseMode(this._parseModeStack.pop());
}else{
if(this._getParseMode()==xap.xml.sax.SaxParser.OPEN_TAG){
if(_479==">"){
if(_47e==null){
_47e=_47b;
}
_47b="";
_478++;
this._startElement(_47e,_47d,_477);
_47e=null;
_47d=new xap.util.Hashtable();
this._setParseMode(this._parseModeStack.pop());
}else{
if(_479=="/"){
this._setParseMode(xap.xml.sax.SaxParser.SELF_CONTAINED_TAG);
}else{
if(_479=="-"&&_47b==("!-")){
this._setParseMode(xap.xml.sax.SaxParser.COMMENT);
}else{
if(_479=="["&&_47b==("![CDATA")){
this._setParseMode(xap.xml.sax.SaxParser.CDSECT);
_47b="";
}else{
if(_479=="E"&&_47b==("!DOCTYP")){
_47b="";
this._setParseMode(xap.xml.sax.SaxParser.DOCDECL);
}else{
if(xap.util.Character.isWhiteSpace(_479)){
_47e=_47b;
_47b="";
this._setParseMode(xap.xml.sax.SaxParser.IN_TAG);
}else{
_47b+=_479;
}
}
}
}
}
}
}else{
if(this._getParseMode()==xap.xml.sax.SaxParser.QUOTE){
if(_479==_47a){
_480=_47b;
_47b="";
_47d[_47f]=_480;
this._setParseMode(xap.xml.sax.SaxParser.IN_TAG);
}else{
if(xap.util.Character.isWhiteSpace(_479)){
_47b+=(" ");
}else{
if(_479=="&"){
this._parseModeStack.push(this._getParseMode());
this._setParseMode(xap.xml.sax.SaxParser.ENTITY_REF);
_47c="";
}else{
_47b+=(_479);
}
}
}
}else{
if(this._getParseMode()==xap.xml.sax.SaxParser.IN_ATTR_VALUE){
if(_479=="\""||_479=="'"){
_47a=_479;
this._setParseMode(xap.xml.sax.SaxParser.QUOTE);
}else{
if(xap.util.Character.isWhiteSpace(_479)){
}else{
this._throwParserException(xap.xml.sax.ParserException.ATTRIBUTE_DELIMITER_MISSING,[]);
}
}
}else{
if(this._getParseMode()==xap.xml.sax.SaxParser.IN_ATTR_KEY){
if(xap.util.Character.isWhiteSpace(_479)){
_47f=_47b;
_47b="";
this._setParseMode(xap.xml.sax.SaxParser.AT_ATTR_EQUALS_SIGN);
}else{
if(_479=="="){
_47f=_47b;
_47b="";
this._setParseMode(xap.xml.sax.SaxParser.IN_ATTR_VALUE);
}else{
_47b+=_479;
}
}
}else{
if(this._getParseMode()==xap.xml.sax.SaxParser.AT_ATTR_EQUALS_SIGN){
if(_479=="="){
this._setParseMode(xap.xml.sax.SaxParser.IN_ATTR_VALUE);
}else{
if(xap.util.Character.isWhiteSpace(_479)){
}else{
this._throwParserException(xap.xml.sax.ParserException.ATTRIBUTE_DELIMITER_MISSING,[]);
}
}
}else{
if(this._getParseMode()==xap.xml.sax.SaxParser.IN_TAG){
if(!this._inContent){
this._inContent;
}
if(_479==">"){
this._setParseMode(this._parseModeStack.pop());
this._startElement(_47e,_47d,_477);
_478++;
_47e=null;
_47d=new Object();
}else{
if(_479=="/"){
this._setParseMode(xap.xml.sax.SaxParser.SELF_CONTAINED_TAG);
}else{
if(xap.util.Character.isWhiteSpace(_479)){
}else{
this._setParseMode(xap.xml.sax.SaxParser.IN_ATTR_KEY);
_47b+=_479;
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
if(this._getParseMode()==xap.xml.sax.SaxParser.END_DOCUMENT){
this._endDocument();
}else{
if(this._getParseMode()==xap.xml.sax.SaxParser.ENTITY_REF){
this._throwParserException(xap.xml.sax.ParserException.UNTERMINATED_ENTITY,[],null);
}else{
this._throwParserException(xap.xml.sax.ParserException.UNEXPECTED_EOF,[],null);
}
}
if(this.handler!=null){
return this.handler.getDocument();
}
};
xap.xml.sax.SaxParser._endsWith=function(_488,_489){
len=_488.length;
lenCandidate=_489.length;
if(len<lenCandidate){
return false;
}
return (_488.substring(len-lenCandidate,len)==_489);
};
xap.xml.sax.SaxParser._excludeDecimalRegexp=/[^01232456789]+/g;
xap.xml.sax.SaxParser._excludeHexRegexp=/[^01232456789ABCDEFabcdef]+/g;
xap.xml.sax.SaxParser._validateNumericEntity=function(_48a){
var _48b=false;
var _48c=_48a.substring(1);
var _48d=xap.xml.sax.SaxParser._excludeDecimalRegexp;
if(_48c.charAt(0)=="x"){
_48d=xap.xml.sax.SaxParser._excludeHexRegexp;
_48c=_48c.substring(1);
}
var _48e=_48c.match(_48d);
if(_48e!=null){
_48b=false;
}else{
_48b=true;
}
return _48b;
};
xap.xml.sax.SaxParser.prototype._throwParserException=function(_48f,_490){
var _491=new Array(0);
for(var i=0;i<_490.length;++i){
_491.push(_490[i]);
}
_491.push(this._currentLine);
_491.push(this._currentColumn);
var _493="";
if(this._data!=null){
var len=this._data.length;
var min=0;
var max=len;
min=Math.max(min,this._cursor-10);
max=Math.min(max,this._cursor+10);
_493+=": Stopped in string:    ..."+this._data.substring(min,this._cursor)+"[STOP]"+this._data.substring(this._cursor,max)+"...."+"\nLast parser mode :"+xap.xml.sax.SaxParser._parseModeStrings[this._getParseMode()];
}
var e=new xap.xml.sax.ParserException(_48f,_491,_493);
throw e;
};
Xap.provide("xap.xml.ie.ParserException");
Xap.require("xap.util.XapException");
xap.xml.ie.ParserException=function(_498,args,_49a){
xap.util.XapException.call(this,_498,args,_49a);
};
xap.xml.ie.ParserException.prototype=new xap.util.XapException;
xap.xml.ie.ParserException.PARSER_EXCEPTION="parserException";
xap.xml.ie.ParserException.CLASSNAME="xap.xml.ie.ParserException";
xap.xml.ie.ParserException.prototype.getClassName=function(){
return xap.xml.ie.ParserException.CLASSNAME;
};
Xap.provide("xap.xml.ie.Parser");
Xap.require("xap.xml.dom.Document");
Xap.require("xap.xml.dom.XapElement");
Xap.require("xap.xml.ie.ParserException");
xap.xml.ie.Parser=function(){
};
xap.xml.ie.Parser.prototype.parse=function(_49b,_49c){
var _49d=new ActiveXObject("Microsoft.XMLDOM");
_49d.async="false";
_49d.loadXML(_49b);
return this._parse(_49d,_49c);
};
xap.xml.ie.Parser.prototype._parse=function(_49e,_49f){
if(_49e.parseError.errorCode!=0){
throw new xap.xml.ie.ParserException(xap.xml.ie.ParserException.PARSER_EXCEPTION,[_49e.parseError.line,_49e.parseError.linepos,_49e.parseError.reason,_49e.parseError.errorCode,_49e.parseError.srcText],null);
}else{
var _4a0=new xap.xml.dom.Document(null);
this._importNativeDocument(_4a0,_49e,_49f);
return _4a0;
}
};
xap.xml.ie.Parser.prototype._importNativeDocument=function(_4a1,_4a2,_4a3){
var _4a4=this._createElement(_4a2.documentElement,_4a1);
this._importNativeElement(_4a4,_4a2.documentElement,_4a1,_4a3);
_4a1.setRootElement(_4a4);
};
xap.xml.ie.Parser.prototype._importNativeElement=function(_4a5,_4a6,_4a7,_4a8){
var _4a9=_4a6.attributes.length;
for(var _4aa=0;_4aa<_4a9;_4aa++){
var _4ab=_4a6.attributes[_4aa];
if(_4ab.name.indexOf("xmlns")!=0){
_4a5.setAttribute(_4ab.name,_4ab.value);
}
}
if(_4a8){
_4a5.baseUrl=_4a8;
}
_4a9=_4a6.childNodes.length;
for(var _4aa=0;_4aa<_4a9;_4aa++){
var _4ac=_4a6.childNodes[_4aa];
if(_4ac.nodeType==google.DOM_ELEMENT_NODE){
var _4ad=this._createElement(_4ac,_4a7);
this._importNativeElement(_4ad,_4ac,_4a7,_4a8);
_4a5.appendChild(_4ad);
}else{
if(_4ac.nodeType==google.DOM_TEXT_NODE||_4ac.nodeType==google.DOM_CDATA_SECTION_NODE){
if(_4ac.nodeValue!=null&&_4ac.nodeValue!=""){
var _4ae=google.XNode.create(google.DOM_TEXT_NODE,null,_4ac.nodeValue,null);
_4a5.appendChild(_4ae);
}
}
}
}
};
xap.xml.ie.Parser.prototype._createElement=function(_4af,_4b0){
var _4b1=null;
if(_4af.namespaceURI==null||_4af.namespaceURI==""){
_4b1=_4b0.createElement(_4af.nodeName);
}else{
var _4b2=_4af.nodeName.indexOf(":");
var _4b3=_4af.nodeName;
var _4b4=null;
if(_4b2!=-1){
_4b4=_4b3.substring(0,_4b2);
_4b3=_4b3.substring(_4b2+1);
}
_4b1=_4b0.createElement(_4b3,_4af.namespaceURI,_4b4);
}
return _4b1;
};
Xap.provide("xap.xml.firefox.ParserException");
Xap.require("xap.util.XapException");
xap.xml.firefox.ParserException=function(_4b5,args,_4b7){
xap.util.XapException.call(this,_4b5,args,_4b7);
};
xap.xml.firefox.ParserException.prototype=new xap.util.XapException();
xap.xml.firefox.ParserException.PARSER_EXCEPTION="parserException";
xap.xml.firefox.ParserException.CLASSNAME="xap.xml.firefox.ParserException";
xap.xml.firefox.ParserException.prototype.getClassName=function(){
return xap.xml.firefox.ParserException.CLASSNAME;
};
Xap.provide("xap.xml.firefox.Parser");
Xap.require("xap.xml.dom.Document");
Xap.require("xap.xml.dom.XapElement");
Xap.require("xap.xml.firefox.ParserException");
xap.xml.firefox.Parser=function(){
};
xap.xml.firefox.Parser.prototype.parse=function(_4b8,_4b9){
var _4ba=new DOMParser();
var _4bb=null;
try{
_4bb=_4ba.parseFromString(_4b8,"text/xml");
}
catch(exception){
throw new xap.xml.firefox.ParserException(xap.xml.firefox.ParserException.PARSER_EXCEPTION,["Parser Exception Occured",exception],null);
}
return this._parse(_4bb,_4b9);
};
xap.xml.firefox.Parser.prototype._parse=function(_4bc,_4bd){
var _4be="http://www.mozilla.org/newlayout/xml/parsererror.xml";
if(_4bc===null){
throw new xap.xml.firefox.ParserException(xap.xml.firefox.ParserException.PARSER_EXCEPTION,["Document Null"],null);
}else{
if(_4bc.documentElement.nodeName=="parsererror"&&_4bc.documentElement.namespaceURI==_4be){
var _4bf=_4bc.documentElement.getElementsByTagNameNS(_4be,"sourcetext")[0];
if(_4bf!==null){
_4bf=_4bf.firstChild.data;
}
throw new xap.xml.firefox.ParserException(xap.xml.firefox.ParserException.PARSER_EXCEPTION,[_4bc.documentElement.firstChild.data,_4bf],null);
}else{
var _4c0=new xap.xml.dom.Document(null);
this._importNativeDocument(_4c0,_4bc,_4bd);
return _4c0;
}
}
};
xap.xml.firefox.Parser.prototype._importNativeDocument=function(_4c1,_4c2,_4c3){
var _4c4=this._createElement(_4c2.documentElement,_4c1);
this._importNativeElement(_4c4,_4c2.documentElement,_4c1,_4c3);
_4c1.setRootElement(_4c4);
};
xap.xml.firefox.Parser.prototype._importNativeElement=function(_4c5,_4c6,_4c7,_4c8){
var _4c9=_4c6.attributes.length;
for(var _4ca=0;_4ca<_4c9;_4ca++){
var _4cb=_4c6.attributes[_4ca];
if(_4cb.name.indexOf("xmlns")!=0){
_4c5.setAttribute(_4cb.name,_4cb.value);
}
}
if(_4c8){
_4c5.baseUrl=_4c8;
}
_4c9=_4c6.childNodes.length;
for(var _4ca=0;_4ca<_4c9;_4ca++){
var _4cc=_4c6.childNodes[_4ca];
if(_4cc.nodeType==google.DOM_ELEMENT_NODE){
var _4cd=this._createElement(_4cc,_4c7);
this._importNativeElement(_4cd,_4cc,_4c7,_4c8);
_4c5.appendChild(_4cd);
}else{
if(_4cc.nodeType==google.DOM_TEXT_NODE||_4cc.nodeType==google.DOM_CDATA_SECTION_NODE){
if(_4cc.nodeValue!=null&&this.trim(_4cc.nodeValue)!=""){
var _4ce=google.XNode.create(google.DOM_TEXT_NODE,null,_4cc.nodeValue,null);
_4c5.appendChild(_4ce);
}
}
}
}
};
xap.xml.firefox.Parser.prototype.trim=function(_4cf){
return _4cf.replace(/^\s+|\s+$/,"");
};
xap.xml.firefox.Parser.prototype._createElement=function(_4d0,_4d1){
var _4d2=null;
if(_4d0.namespaceURI==null||_4d0.namespaceURI==""){
_4d2=_4d1.createElement(_4d0.nodeName);
}else{
var _4d3=_4d0.nodeName.indexOf(":");
var _4d4=_4d0.nodeName;
var _4d5=null;
if(_4d3!=-1){
_4d5=_4d4.substring(0,_4d3);
_4d4=_4d4.substring(_4d3+1);
}
_4d2=_4d1.createElement(_4d4,_4d0.namespaceURI,_4d5);
}
return _4d2;
};
Xap.provide("xap.xml.ParserFactory");
Xap.require("xap.xml.sax.SaxContentHandler");
Xap.require("xap.xml.sax.SaxParser");
Xap.require("xap.xml.ie.Parser");
Xap.require("xap.xml.firefox.Parser");
xap.xml.ParserFactory=function(){
};
xap.xml.ParserFactory.getParser=function(){
if(dojo.render.html.ie){
var _4d6=new xap.xml.ie.Parser();
return _4d6;
}else{
if(document.implementation&&document.implementation.createDocument){
var _4d6=new xap.xml.firefox.Parser();
return _4d6;
}else{
var _4d6=new xap.xml.sax.SaxParser(new xap.xml.sax.SaxContentHandler());
return _4d6;
}
}
};
Xap.provide("xap.xml.UiNamespaceShortcutHandler");
Xap.require("xap.log.Logger");
xap.xml.UiNamespaceShortcutHandler=function(_4d7){
this._session=_4d7;
};
xap.xml.UiNamespaceShortcutHandler.s_log=xap.log.Logger.getLogger("xap.xml.UiNamespaceShortcutHandler");
xap.xml.UiNamespaceShortcutHandler.prototype.receiveDispatch=function(_4d8){
if(xap.xml.UiNamespaceShortcutHandler.s_log.isTrace()){
xap.xml.UiNamespaceShortcutHandler.s_log.trace("receiveDispatch:"+_4d8);
}
var _4d9=this._session.getDocumentContainer().getUiDocument();
var _4da=_4d9.getRootElement();
_4da.appendChild(_4d8);
};
Xap.provide("xap.taghandling.PluginRegistryImpl");
Xap.require("xap.xml.DocumentContainer");
Xap.require("xap.util.Hashtable");
Xap.require("google.xpath");
Xap.require("xap.xml.ParserFactory");
Xap.require("xap.log.Logger");
Xap.require("xap.xml.UiNamespaceShortcutHandler");
xap.taghandling.PluginRegistryImpl=function(_4db){
this._pluginLifecycleObjects=[];
this._tagDefinitions=new xap.util.Hashtable();
this._tagMappings=new xap.util.Hashtable();
this._tagLocations=new xap.util.Hashtable();
this._session=_4db;
this._uiShortcutNamespaceHandler=new xap.xml.UiNamespaceShortcutHandler(_4db);
};
xap.taghandling.PluginRegistryImpl.s_log=xap.log.Logger.getLogger("xap.taghandling.PluginRegistryImpl");
xap.taghandling.PluginRegistryImpl.TAG_MAPPINGS_PATH="/plugin/tag-mappings";
xap.taghandling.PluginRegistryImpl.UNMAPPED_TAGS_PATH="/plugin/unmapped-tags";
xap.taghandling.PluginRegistryImpl.PLUGIN_LIFECYCLE_CLASS_PATH="/plugin/@class";
xap.taghandling.PluginRegistryImpl.NO_MAPPED_CLASS=new Object();
xap.taghandling.PluginRegistryImpl.prototype.addPluginDescription=function(_4dc,_4dd){
if(xap.taghandling.PluginRegistryImpl.s_log.isTrace()){
xap.taghandling.PluginRegistryImpl.s_log.trace("Add plugin description");
}
var _4de=xap.xml.ParserFactory.getParser();
var _4df=null;
try{
_4df=_4de.parse(_4dc);
}
catch(exception){
this._session.handleException(exception);
return;
}
if(xap.taghandling.PluginRegistryImpl.s_log.isTrace()){
xap.taghandling.PluginRegistryImpl.s_log.trace("Parse mapped tags");
}
var _4e0=google.xpathDomEval(xap.taghandling.PluginRegistryImpl.TAG_MAPPINGS_PATH,_4df);
if(xap.taghandling.PluginRegistryImpl.s_log.isTrace()){
xap.taghandling.PluginRegistryImpl.s_log.trace(_4e0.value.length+" mapped tags");
}
this._parseTagMappingElements(_4e0.value,true,_4dd);
if(xap.taghandling.PluginRegistryImpl.s_log.isTrace()){
xap.taghandling.PluginRegistryImpl.s_log.trace("Parse unmapped tags");
}
_4e0=google.xpathDomEval(xap.taghandling.PluginRegistryImpl.UNMAPPED_TAGS_PATH,_4df);
if(xap.taghandling.PluginRegistryImpl.s_log.isTrace()){
xap.taghandling.PluginRegistryImpl.s_log.trace(_4e0.value.length+" unmapped tags");
}
this._parseTagMappingElements(_4e0.value,false,_4dd);
var _4e1=google.xpathDomEval(xap.taghandling.PluginRegistryImpl.PLUGIN_LIFECYCLE_CLASS_PATH,_4df).value[0];
if(_4e1&&_4e1.length>0){
this.loadLifecycleObject(_4e1);
}
};
xap.taghandling.PluginRegistryImpl.prototype.loadLifecycleObject=function(_4e2){
if(xap.taghandling.PluginRegistryImpl.s_log.isTrace()){
xap.taghandling.PluginRegistryImpl.s_log.trace("lifecycle class = "+_4e2);
}
if(_4e2){
try{
var _4e3=null;
if(Xap.require(_4e2)){
_4e3=eval(_4e2);
}
if(!_4e3){
throw new Error("Unable to load class "+_4e2);
}
var _4e4=new _4e3(this._session);
if(_4e4.pluginLoaded){
_4e4.pluginLoaded(this._session);
}
this._pluginLifecycleObjects.push(_4e4);
}
catch(exception){
this._session.handleException(exception);
}
}
};
xap.taghandling.PluginRegistryImpl.prototype.getPluginDefinition=function(_4e5,_4e6,_4e7){
var _4e8=xap.taghandling.PluginRegistryImpl._createHashtableKey(_4e5,_4e6,_4e7);
return this._tagDefinitions.get(_4e8);
};
xap.taghandling.PluginRegistryImpl.prototype.getTagMapping=function(_4e9,_4ea,_4eb){
return this._tagMappings.get(xap.taghandling.PluginRegistryImpl._createHashtableKey(_4e9,_4ea,_4eb));
};
xap.taghandling.PluginRegistryImpl.prototype.getPluginRoot=function(_4ec,_4ed,_4ee){
return this._tagLocations.get(xap.taghandling.PluginRegistryImpl._createHashtableKey(_4ec,_4ed,_4ee));
};
xap.taghandling.PluginRegistryImpl.prototype._parseTagMappingElements=function(_4ef,_4f0,_4f1){
for(var _4f2=0;_4f2<_4ef.length;_4f2++){
var _4f3=_4ef[_4f2];
var _4f4=_4f3.getAttribute("document");
if(_4f4==null){
_4f4=xap.xml.DocumentContainer.UI_DOCUMENT_NAME;
}
var _4f5=_4f3.getAttribute("namespace");
var _4f6=_4f5.split(" ");
for(var _4f7=0;_4f7<_4f6.length;_4f7++){
_4f5=_4f6[_4f7];
if(!_4f5&&_4f0){
continue;
}
if(_4f4==xap.xml.DocumentContainer.UI_DOCUMENT_NAME){
if(this._session&&!this._session.getNamespaceHandlerManager()._namespaceToHandlersMap.get(_4f5)){
this._session.getNamespaceHandlerManager().addHandler(_4f5,this._uiShortcutNamespaceHandler);
}
}
for(var i=0;i<_4f3.childNodes.length;i++){
var _4f9=_4f3.childNodes[i];
var _4fa=null;
var _4fb=null;
if(_4f9.getLocalName()=="mapping"){
_4fb=_4f9.getAttribute("name");
if(_4fb==null||_4fb.length==0){
if(xap.taghandling.PluginRegistryImpl.s_log.isError()){
xap.taghandling.PluginRegistryImpl.s_log.error("Missing tag name (\"local name\") from tag element:\n"+_4f9+"\n...; mapping will continue for other tag defs.");
}
continue;
}
if(_4f0){
_4fa=_4f9.getAttribute("class");
if(_4fa==null||_4fa.length==0){
continue;
}
}else{
_4fa=xap.taghandling.PluginRegistryImpl.NO_MAPPED_CLASS;
}
}else{
}
if(xap.taghandling.PluginRegistryImpl.s_log.isTrace()){
xap.taghandling.PluginRegistryImpl.s_log.trace("Add tag mapping:"+_4fb+":"+_4fa);
}
this._addTagMapping(_4fb,_4fa,_4f5,_4f4,_4f9,_4f1);
}
}
}
};
xap.taghandling.PluginRegistryImpl.prototype.toString=function(){
return this._tagMappings.toString();
};
xap.taghandling.PluginRegistryImpl.prototype._addTagMapping=function(_4fc,_4fd,_4fe,_4ff,_500,_501){
if(this.getTagMapping(_4fc,_4fe,_4ff)!=null){
}
var _502=xap.taghandling.PluginRegistryImpl._createHashtableKey(_4fc,_4fe,_4ff);
this._tagMappings.put(_502,_4fd);
this._tagDefinitions.put(_502,_500);
if(_501){
this._tagLocations.put(_502,_501.substring(0,_501.lastIndexOf("/")));
}
};
xap.taghandling.PluginRegistryImpl._createHashtableKey=function(_503,_504,_505){
return _503+":"+_504+":"+_505;
};
dojo.provide("dojo.uri.Uri");
dojo.uri=new function(){
this.dojoUri=function(uri){
return new dojo.uri.Uri(dojo.hostenv.getBaseScriptUri(),uri);
};
this.moduleUri=function(_507,uri){
var loc=dojo.hostenv.getModuleSymbols(_507).join("/");
if(!loc){
return null;
}
if(loc.lastIndexOf("/")!=loc.length-1){
loc+="/";
}
return new dojo.uri.Uri(dojo.hostenv.getBaseScriptUri()+loc,uri);
};
this.Uri=function(){
var uri=arguments[0];
for(var i=1;i<arguments.length;i++){
if(!arguments[i]){
continue;
}
var _50c=new dojo.uri.Uri(arguments[i].toString());
var _50d=new dojo.uri.Uri(uri.toString());
if((_50c.path=="")&&(_50c.scheme==null)&&(_50c.authority==null)&&(_50c.query==null)){
if(_50c.fragment!=null){
_50d.fragment=_50c.fragment;
}
_50c=_50d;
}else{
if(_50c.scheme==null){
_50c.scheme=_50d.scheme;
if(_50c.authority==null){
_50c.authority=_50d.authority;
if(_50c.path.charAt(0)!="/"){
var path=_50d.path.substring(0,_50d.path.lastIndexOf("/")+1)+_50c.path;
var segs=path.split("/");
for(var j=0;j<segs.length;j++){
if(segs[j]=="."){
if(j==segs.length-1){
segs[j]="";
}else{
segs.splice(j,1);
j--;
}
}else{
if(j>0&&!(j==1&&segs[0]=="")&&segs[j]==".."&&segs[j-1]!=".."){
if(j==segs.length-1){
segs.splice(j,1);
segs[j-1]="";
}else{
segs.splice(j-1,2);
j-=2;
}
}
}
}
_50c.path=segs.join("/");
}
}
}
}
uri="";
if(_50c.scheme!=null){
uri+=_50c.scheme+":";
}
if(_50c.authority!=null){
uri+="//"+_50c.authority;
}
uri+=_50c.path;
if(_50c.query!=null){
uri+="?"+_50c.query;
}
if(_50c.fragment!=null){
uri+="#"+_50c.fragment;
}
}
this.uri=uri.toString();
var _511="^(([^:/?#]+):)?(//([^/?#]*))?([^?#]*)(\\?([^#]*))?(#(.*))?$";
var r=this.uri.match(new RegExp(_511));
this.scheme=r[2]||(r[1]?"":null);
this.authority=r[4]||(r[3]?"":null);
this.path=r[5];
this.query=r[7]||(r[6]?"":null);
this.fragment=r[9]||(r[8]?"":null);
if(this.authority!=null){
_511="^((([^:]+:)?([^@]+))@)?([^:]*)(:([0-9]+))?$";
r=this.authority.match(new RegExp(_511));
this.user=r[3]||null;
this.password=r[4]||null;
this.host=r[5];
this.port=r[7]||null;
}
this.toString=function(){
return this.uri;
};
};
};
Xap.kwCompoundRequire({common:["google.dom","google.misc","google.xpath"]});
Xap.provide("google.*");
Xap.provide("xap.taghandling.PluginDocumentHandler");
Xap.require("dojo.uri.Uri");
Xap.require("xap.xml.dom.events.StructureChangeEvent");
Xap.require("xap.util.Hashtable");
Xap.require("google.*");
xap.taghandling.PluginDocumentHandler=function(_513,doc,_515){
this._elementsToBridges=new xap.util.Hashtable();
this._peersToBridges=new xap.util.Hashtable();
this._clientSession=_513;
this._documentName=_515;
doc.addStructureChangeListener(this);
};
xap.taghandling.PluginDocumentHandler.s_log=xap.log.Logger.getLogger("xap.taghandling.PluginDocumentHandler");
xap.taghandling.PluginDocumentHandler.prototype.onChildAdded=function(e){
if(e.getType()==xap.xml.dom.events.StructureChangeEvent.TEXT_NODE){
return;
}
this.parseChild(e.getChange(),e);
};
xap.taghandling.PluginDocumentHandler.prototype.onChildRemoved=function(e){
};
xap.taghandling.PluginDocumentHandler.prototype.beforeChildAdded=function(_518){
};
xap.taghandling.PluginDocumentHandler.prototype.beforeChildRemoved=function(_519){
};
xap.taghandling.PluginDocumentHandler.prototype.deregister=function(el){
var _51b=this.getHandlerForElement(el);
if(_51b){
this._elementsToBridges.remove(el);
if(_51b.unload){
_51b.unload();
}
el.removeAttributeChangeListener(_51b);
el.removeStructureChangeListener(_51b);
}
for(var i=0;i<el.childNodes.length;i++){
var _51d=el.childNodes[i];
if(_51d.nodeType==google.DOM_ELEMENT_NODE){
this.deregister(_51d);
}
}
};
xap.taghandling.PluginDocumentHandler.prototype.obtainHandler=function(_51e,_51f){
var _520=Xap.resolveConstructor(_51e);
try{
if(!_520){
if(_51f){
var _521=_51e.substring(0,_51e.lastIndexOf("."));
if(!dojo.hostenv.moduleHasPrefix(_521)){
var path=_51f+"/"+_521.replace(/\./g,"/");
dojo.hostenv.setModulePrefix(_521,path);
}
}
Xap.require(_51e);
_520=Xap.resolveConstructor(_51e);
}
}
catch(classNotLoadableException){
xap.taghandling.PluginDocumentHandler.s_log.error("Exception while loading: "+_51e,classNotLoadableException);
throw classNotLoadableException;
}
return new _520();
};
xap.taghandling.PluginDocumentHandler.prototype.parseChild=function(_523,_524){
var _525=this._clientSession.getPluginRegistry();
try{
var _526=_523.getLocalName();
var _527=_523.getNamespaceUri();
var _528=_525.getTagMapping(_526,_527,this._documentName);
var _529=_525.getPluginRoot(_526,_527,this._documentName);
if(_528===undefined){
if(xap.taghandling.PluginDocumentHandler.s_log.isWarn()){
xap.taghandling.PluginDocumentHandler.s_log.warn("No mapping for tag name ["+_526+"] with namespace ["+_527+"] on document ["+this._documentName+"]");
}
return null;
}else{
if((typeof _528)!="string"){
return null;
}
}
var _52a=null;
try{
_52a=this.obtainHandler(_528,_529);
}
catch(ex){
xap.taghandling.PluginDocumentHandler.s_log.error("Exception during eval",ex);
}
this.setHandlerForElement(_523,_52a);
_52a.setSession(this._clientSession);
_523.addStructureChangeListener(_52a);
_523.addAttributeChangeListener(_52a);
_52a.setElement(_523,_524);
_52a.init();
_52a.fireEvent("onCreate");
}
catch(ex){
this._clientSession.handleException(ex);
}
return _52a;
};
xap.taghandling.PluginDocumentHandler.prototype.getHandlerForElement=function(el){
return this._elementsToBridges.get(el);
};
xap.taghandling.PluginDocumentHandler.prototype.setHandlerForElement=function(el,_52d){
this._elementsToBridges.put(el,_52d);
};
xap.taghandling.PluginDocumentHandler.prototype.setHandlerForPeer=function(peer,_52f){
this._peersToBridges.put(peer,_52f);
};
xap.taghandling.PluginDocumentHandler.prototype.removeHandlerForPeer=function(peer){
this._peersToBridges.remove(peer);
};
xap.taghandling.PluginDocumentHandler.prototype.getHandlerForPeer=function(peer){
return this._peersToBridges.get(peer);
};
Xap.provide("xap.session.ClientEvent");
xap.session.ClientEvent=function(_532,_533){
this.source=_532;
this.session=_533;
};
xap.session.ClientEvent.prototype.toString=function(){
var _534="xap.session.ClientEvent:";
for(var i in this){
if(typeof (this[i])!="function"){
_534+="\n"+i+" : "+this[i];
}
}
return _534;
};
Xap.provide("xap.resolver.ResolutionInfo");
xap.resolver.ResolutionInfo=function(){
};
xap.resolver.ResolutionInfo.WHOLE_ATTRIBUTE=1;
xap.resolver.ResolutionInfo.WHOLE_TEXT_NODE=2;
xap.resolver.ResolutionInfo.createWholeAttributeReplacement=function(_536,_537){
var info=new xap.resolver.ResolutionInfo();
info._resolutionType=xap.resolver.ResolutionInfo.WHOLE_ATTRIBUTE;
info._attributeName=_537;
info._sourceElement=_536;
return info;
};
Xap.provide("xap.util.TypeUtils");
Xap.require("google.*");
xap.util.TypeUtils=function(){
};
xap.util.TypeUtils.convertToString=function(obj){
obj=xap.util.TypeUtils._unwrapCollection(obj);
obj=xap.util.TypeUtils._unwrapDomType(obj);
if(obj){
return ""+obj;
}
return obj;
};
xap.util.TypeUtils.convertToNumber=function(obj){
if(typeof obj!="number"){
obj=xap.util.TypeUtils.convertToString(obj);
return parseFloat(obj);
}
return obj;
};
xap.util.TypeUtils.convertToArray=function(obj){
var _53c=new Array();
if(obj instanceof Array){
for(var i=0;i<obj.length;i++){
_53c.push(xap.util.TypeUtils._unwrapDomType(obj[i]));
}
}else{
_53c.push(xap.util.TypeUtils._unwrapDomType(obj));
}
return _53c;
};
xap.util.TypeUtils._unwrapDomType=function(obj){
if(obj instanceof google.XNode){
if(obj.nodeType==google.DOM_TEXT_NODE){
return obj.nodeValue;
}else{
if(obj.nodeType==google.DOM_ATTRIBUTE_NODE){
return obj.nodeValue;
}else{
if(obj.nodeType==google.DOM_ELEMENT_NODE){
if(obj.firstChild&&obj.firstChild.nodeType==google.DOM_TEXT_NODE){
return obj.firstChild.nodeValue;
}
return null;
}
}
}
}
return obj;
};
xap.util.TypeUtils._unwrapCollection=function(obj){
if(obj instanceof Array){
if(obj.length>0){
return obj[0];
}
}
return obj;
};
Xap.provide("xap.util.EscapeSyntaxParser");
Xap.require("xap.util.Exception");
xap.util.EscapeSyntaxParser=function(_540,_541,_542,_543){
this._escapeLead=_540;
this._escapeSequenceCharacters=_541;
this._resolvedCharacters=_542;
this._reportUnknownEscapeSequencesAsErrors=_543;
};
xap.util.EscapeSyntaxParser.UNRESOLVED_CHARACTER=new Object();
xap.util.EscapeSyntaxParser.prototype.getResolvedCharacter=function(s,_545){
var c=s.charAt(_545);
if(c!=this._escapeLead){
return xap.util.EscapeSyntaxParser.UNRESOLVED_CHARACTER;
}
if(_545+1>=s.length&&this._reportUnknownEscapeSequencesAsErrors){
throw new xap.util.Exception("Invalid escape sequence: "+this._escapeLead+" at index "+_545+" in string: "+s);
}
var _547=s.charAt(_545+1);
for(var i=0;i<this._escapeSequenceCharacters.length;i++){
if(_547==this._escapeSequenceCharacters[i]){
return this._resolvedCharacters[i];
}
}
if(this._reportUnknownEscapeSequencesAsErrors){
throw new xap.util.Exception("Invalid escape sequence: "+this._escapeLead+_547+" at index "+_545+" in string: "+s);
}
return xap.util.EscapeSyntaxParser.UNRESOLVED_CHARACTER;
};
xap.util.EscapeSyntaxParser.prototype.escape=function(s){
var b=new String();
for(var i=0;i<s.length;i++){
var c=s.charAt(i);
var _54d=false;
for(var j=0;j<this._resolvedCharacters.length;j++){
if(c==this._resolvedCharacters[j]){
b+=this._escapeLead;
b+=this._escapeSequenceCharacters[j];
_54d=true;
break;
}
}
if(!_54d){
b+=c;
}
}
return b;
};
xap.util.EscapeSyntaxParser.prototype.parse=function(s){
var _550=null;
for(var i=0;i<s.length;i++){
var c=this.getResolvedCharacter(s,i);
if(c==xap.util.EscapeSyntaxParser.UNRESOLVED_CHARACTER){
if(_550!=null){
_550+=s.charAt(i);
}
}else{
if(_550==null){
_550=s.substring(0,i);
}
_550+=c;
i++;
}
}
return _550==null?s:_550;
};
Xap.provide("xap.resolver.ResolutionHandler");
Xap.require("xap.session.ClientEvent");
Xap.require("xap.resolver.ResolutionInfo");
Xap.require("xap.util.TypeUtils");
Xap.require("xap.util.EscapeSyntaxParser");
xap.resolver.ResolutionHandler=function(_553){
this._session=_553;
};
xap.resolver.ResolutionHandler.escapeSyntax=new xap.util.EscapeSyntaxParser("\\",["\\","{","}"],["\\","{","}"],false);
xap.resolver.ResolutionHandler.prototype.unescape=function(_554){
if(_554&&_554.length>0&&_554.charAt(0)=="\\"){
return xap.resolver.ResolutionHandler.escapeSyntax.parse(_554);
}
return _554;
};
xap.resolver.ResolutionHandler.prototype.resolveAttribute=function(_555,_556){
var _557=_555.getNewValue();
_557=_557.substring(1,_557.length-1);
var info=xap.resolver.ResolutionInfo.createWholeAttributeReplacement(_556,_555.getName());
var _559=new xap.session.ClientEvent(_556,this._session);
_559._resolverInfo=info;
this._clientEvent=_559;
var _55a=this._session.getEventHandler();
try{
var _55b=this._session.getDeclarativeArgumentParser();
var _55c=_55b.parseArgument(_557,0,_556,_559);
delete this._clientEvent;
if(!_55c._resultObject){
return "";
}
return xap.util.TypeUtils.convertToString(_55c._resultObject);
}
catch(anException){
this._session.handleException(anException);
}
};
xap.resolver.ResolutionHandler.prototype.needsResolving=function(_55d){
return !(_55d==null||_55d.length<2||_55d.charAt(0)!="{"||_55d.charAt(_55d.length-1)!="}");
};
Xap.provide("xap.taghandling.AbstractTagImpl");
Xap.require("xap.xml.dom.events.StructureChangeEvent");
Xap.require("xap.xml.dom.events.AttributeChangeEvent");
Xap.require("xap.session.ClientEvent");
Xap.require("google.*");
Xap.require("xap.xml.InvalidXmlException");
xap.taghandling.AbstractTagImpl=function(){
this._element=null;
this._peer=null;
this._clientSession=null;
};
xap.taghandling.AbstractTagImpl.TAIL_RECURSION=false;
xap.taghandling.AbstractTagImpl.prototype.getElement=function(){
return this._element;
};
xap.taghandling.AbstractTagImpl.prototype.setElement=function(el,_55f){
this._element=el;
if(_55f&&_55f.getIndex()>=0){
this._index=_55f.getIndex();
}
};
xap.taghandling.AbstractTagImpl.prototype.getPeer=function(){
return this._peer;
};
xap.taghandling.AbstractTagImpl.prototype.init=function(){
};
xap.taghandling.AbstractTagImpl.prototype.setPeer=function(obj){
this._peer=obj;
this.getUiContentHandler().setHandlerForPeer(obj,this);
};
xap.taghandling.AbstractTagImpl.prototype.unload=function(){
if(this._peer){
this.getUiContentHandler().removeHandlerForPeer(this._peer);
}
};
xap.taghandling.AbstractTagImpl.prototype.getUiDocument=function(){
return this.getSession().getDocumentContainer().getUiDocument();
};
xap.taghandling.AbstractTagImpl.prototype.parseInitialAttributes=function(e){
var _562=e.attributes;
var _563=new Array(_562.length);
for(var i=0;i<_562.length;i++){
var _565=e.attributes[i].nodeName;
_563[i]=_565;
}
for(var i=0;i<_563.length;i++){
var _565=_563[i];
var _566=e.getAttribute(_565);
var _567=new xap.xml.dom.events.AttributeChangeEvent(e,_565,_566);
this.beforeAttributeSet(_567);
if(_567.getNewValue()!=_567.getOldValue()){
this.writeBackAttribute(_565,_567.getNewValue());
}
this.onAttributeSet(_567);
}
};
xap.taghandling.AbstractTagImpl.prototype.parseInitialChildren=function(e){
if(!xap.taghandling.AbstractTagImpl.TAIL_RECURSION){
var _569=this.getElement().parentNode;
var _56a=this.getUiContentHandler().getHandlerForElement(_569);
var _56b=this._index>=0?this._index:-1;
var _56c=new xap.xml.dom.events.StructureChangeEvent(e,this.getElement(),_56b);
_56a.beforeChildAdded(_56c);
_56a.childAdded(_56c);
if(this._index>=0){
delete this._index;
}
}
var _56d=this.getSession();
var _56e=_56d.getUiDocumentHandler();
var _56f=new Array(e.childNodes.length);
for(var i=0;i<_56f.length;i++){
_56f[i]=e.childNodes[i];
}
for(var i=0;i<_56f.length;i++){
var _571=_56f[i];
if(_571.nodeType==google.DOM_ELEMENT_NODE){
_56e.parseChild(_571);
if(xap.taghandling.AbstractTagImpl.TAIL_RECURSION){
var _56c=new xap.xml.dom.events.StructureChangeEvent(e,_571,-1);
this.beforeChildAdded(_56c);
this.onChildAdded(_56c);
}
}
if(_571.nodeType==google.DOM_TEXT_NODE){
if(xap.taghandling.AbstractTagImpl.TAIL_RECURSION){
var _56c=new xap.xml.dom.events.StructureChangeEvent(e,_571,-1);
this.beforeChildAdded(_56c);
this.onChildAdded(_56c);
}
}
}
};
xap.taghandling.AbstractTagImpl.prototype.getUrlContext=function(){
return this.getSession().getUrlContext();
};
xap.taghandling.AbstractTagImpl.prototype.fireEvent=function(_572,_573,_574,_575){
var _576=this.getSession();
if(_574==null){
_574=this.getElement();
}
if(_573==null){
_573=_574.getAttribute(_572);
if(_573&&_576.getEventHandler().isUrlEvent(_573)){
_573=_574.getAttributeAsUrl(_572);
}
}
if(_573==null){
return null;
}
if(_575==null){
_575=new xap.session.ClientEvent(_574,this.getSession());
}
_575.id=_574.getAttribute("id");
_575.event=_572;
return _576.getEventHandler().fireEvent(_572,_573,_574,_575);
};
xap.taghandling.AbstractTagImpl.prototype.getUiContentHandler=function(){
return this.getSession().getUiDocumentHandler();
};
xap.taghandling.AbstractTagImpl.prototype.writeBackTextNode=function(_577){
var _578=this.getElement();
_578.removeStructureChangeListener(this);
var _579=_578.firstChild;
if(!_579){
_578.appendChild(_578.ownerDocument.createTextNode(_577));
}else{
if(_579.nodeType==google.DOM_TEXT_NODE){
_579.nodeValue=_577;
}
}
_578.addStructureChangeListener(this);
};
xap.taghandling.AbstractTagImpl.prototype.writeBackAttribute=function(name,_57b){
this.getElement().removeAttributeChangeListener(this);
this.getElement().setAttribute(name,_57b);
this.getElement().addAttributeChangeListener(this);
};
xap.taghandling.AbstractTagImpl.prototype.writeBackRemoveAttribute=function(name){
this.getElement().removeAttributeChangeListener(this);
this.getElement().removeAttribute(name);
this.getElement().addAttributeChangeListener(this);
};
xap.taghandling.AbstractTagImpl.prototype.attributeSet=function(_57d){
};
xap.taghandling.AbstractTagImpl.prototype.onChildAdded=function(e){
if(xap.taghandling.AbstractTagImpl.TAIL_RECURSION){
this.childAdded(e);
}
};
xap.taghandling.AbstractTagImpl.prototype.childAdded=function(e){
};
xap.taghandling.AbstractTagImpl.prototype.beforeChildAdded=function(e){
};
xap.taghandling.AbstractTagImpl.prototype.beforeChildRemoved=function(e){
};
xap.taghandling.AbstractTagImpl.prototype.onChildRemoved=function(e){
if(e.getType()==xap.xml.dom.events.StructureChangeEvent.ELEMENT_NODE){
this.getUiContentHandler().deregister(e.getChange());
}
};
xap.taghandling.AbstractTagImpl.prototype.afterChildRemoved=function(e){
if(e.getType()==xap.xml.dom.events.StructureChangeEvent.ELEMENT_NODE){
this.getUiContentHandler().deregister(e.getChange());
}
};
xap.taghandling.AbstractTagImpl.prototype.onAttributeSet=function(e){
try{
this.attributeSet(e);
}
catch(ex){
this.reportInvalidXmlException(e.getName(),e.getNewValue(),this.getElement(),ex);
}
};
xap.taghandling.AbstractTagImpl.prototype.onAttributeRemoved=function(e){
};
xap.taghandling.AbstractTagImpl.prototype.beforeAttributeSet=function(_586){
var _587=this.getSession().getResolutionHandler();
if(_587.needsResolving(_586.getNewValue())){
_586.setNewValue(_587.resolveAttribute(_586,this.getElement()));
}else{
_586.setNewValue(_587.unescape(_586.getNewValue()));
}
};
xap.taghandling.AbstractTagImpl.prototype.reportInvalidXmlException=function(_588,_589,el,ex){
var _58c=this.constructInvalidXmlException(_588,_589,el,ex);
this.getSession().handleException(_58c);
};
xap.taghandling.AbstractTagImpl.prototype.constructInvalidXmlException=function(_58d,_58e,e,ex){
var _591=new xap.xml.InvalidXmlException(xap.xml.InvalidXmlException.BAD_ATTRIBUTE_WITH_ROOT_CAUSE,[_58d,_58e,e.toXml(),xap.util.XapException.exceptionToString(ex)]);
return _591;
};
xap.taghandling.AbstractTagImpl.prototype.getSession=function(){
return this._clientSession;
};
xap.taghandling.AbstractTagImpl.prototype.setSession=function(_592){
this._clientSession=_592;
};
Xap.provide("xap.session.EventHandler");
Xap.require("xap.util.Exception");
Xap.require("xap.util.XapException");
xap.session.EventHandler=function(_593){
this._session=_593;
};
xap.session.EventHandler.prototype.fireEvent=function(_594,_595,_596,_597){
if(this.isObjectEvent(_595)){
try{
return this._handleObjectEvent(_595,_596,_597);
}
catch(exception){
this._session.handleException(exception);
}
}else{
if(this.isJavascriptEvent(_595)){
try{
_595=_595.substr(11);
var o=eval(_595);
if(typeof (o)=="function"){
return o.call(null,_597);
}else{
return o;
}
}
catch(exception){
this._session.handleException(exception);
}
}else{
try{
this._session.getRequestService().retrieveAndProcessAsynchronously(_595,this);
}
catch(exception){
this._session.handleException(exception);
}
}
}
return null;
};
xap.session.EventHandler.prototype.requestCompleted=function(){
};
xap.session.EventHandler.prototype.requestFailed=function(url,_59a,_59b){
this._session.handleException(_59b);
};
xap.session.EventHandler.prototype._handleObjectEvent=function(_59c,_59d,_59e){
var _59f=_59c.indexOf("(");
var _5a0=_59c.indexOf(")");
var _5a1=_59c.indexOf(".");
if(_59f==-1||_5a0==-1||_5a1==-1||!(_5a1<_59f&&_59f<_5a0)){
throw new xap.util.Exception(" bad parens and period or something",null,null,"xap.session.EventHandler._handleObjectEvent");
}
var _5a2=this._session.getDeclarativeArgumentParser().parseArgument(_59c,0,_59d,_59e);
return _5a2._resultObject;
};
xap.session.EventHandler.prototype.isObjectEvent=function(_5a3){
var _5a4=_5a3.indexOf(":");
if(_5a4==-1){
return false;
}
var _5a5=_5a3.substring(0,_5a4);
return (this._session.getContainer(_5a5)!=null);
};
xap.session.EventHandler.prototype.isJavascriptEvent=function(_5a6){
return _5a6.indexOf("javascript:")==0;
};
xap.session.EventHandler.prototype.isUrlEvent=function(_5a7){
return !this.isJavascriptEvent(_5a7)&&!this.isObjectEvent(_5a7);
};
Xap.provide("xap.session.DeclarativeArgumentParser");
Xap.require("xap.util.Exception");
Xap.require("xap.util.Character");
Xap.require("xap.log.Logger");
Xap.require("xap.util.Hashtable");
Xap.require("xap.util.EscapeSyntaxParser");
xap.session.DeclarativeArgumentParser=function(_5a8){
this._log=xap.session.DeclarativeArgumentParser.s_log;
this._session=_5a8;
this._functionShortcuts=new xap.util.Hashtable();
this._session.getSystemContainer().put("McoArgumentParser",this);
};
xap.session.DeclarativeArgumentParser.s_stringArgumentParser=new xap.util.EscapeSyntaxParser("\\",["\\","\""],["\\","\""],false);
xap.session.DeclarativeArgumentParser.s_stringApostropheArgumentParser=new xap.util.EscapeSyntaxParser("\\",["\\","'"],["\\","'"],false);
xap.session.DeclarativeArgumentParser.s_log=xap.log.Logger.getLogger("xap.session.DeclarativeArgumentParser");
String.prototype.trim=function(){
return this.replace(/^\s+|\s+$/g,"");
};
xap.session.DeclarativeArgumentParser.prototype.parseArgument=function(args,_5aa,_5ab,_5ac){
if(this._log.isTrace()){
this._log.trace("Parse argument [ "+args+"] at start index:"+_5aa);
}
var arg=new String();
var _5ae=null;
for(var _5af=_5aa;_5af<args.length;_5af++){
var c=args.charAt(_5af);
if(_5ae!=null){
if(c==","){
_5ae._terminatingIndex=_5af;
_5ae._parseStatus=this._ParseResult.COMMA_ENCOUNTERED;
return _5ae;
}else{
if(c==")"){
_5ae._terminatingIndex=_5af;
_5ae._parseStatus=this._ParseResult.CLOSING_PAREN;
return _5ae;
}else{
if(xap.util.Character.isWhiteSpace(c)){
}else{
this._log.trace("Hit a character after the full arg:"+arg);
throw new xap.util.Exception("Bad parameter trailing characters");
}
}
}
}else{
if(_5ae==null){
if((c=="\""||c=="'")&&arg.trim().length==0){
_5ae=this._parseString(args,_5af,c);
_5af=_5ae._terminatingIndex;
}else{
if(c=="("){
var _5b1=this._parseArguments(args,_5ab,_5af+1,_5ac);
var mco=arg.trim();
var _5b3=this._functionShortcuts.get(mco);
if(_5b3!=null){
mco=_5b3;
}
var _5b4=mco.indexOf(":");
var _5b5=null;
if(_5b4!=-1){
_5b5=mco.substring(0,_5b4);
mco=mco.substring(_5b4+1);
}
var _5b6=mco.lastIndexOf(".");
if(_5b6==-1||_5b6==0||_5b6==mco.length-1){
throw new xap.util.Exception("Missing period in: '"+mco+"'.");
}
var _5b7=mco.substring(0,_5b6);
var _5b8=mco.substring(_5b6+1);
var _5b9=this._fireObjectEvent(_5b5,_5b7,_5b8,_5b1._resultObject);
_5ae=new this._ParseResult(_5b9,_5b1._terminatingIndex);
_5af=_5b1._terminatingIndex;
}else{
if(c==","){
return new this._ParseResult(this._stringToMcoArgument(arg,_5ab,_5ac),_5af,this._ParseResult.COMMA_ENCOUNTERED);
}else{
if(c==")"){
if(arg.trim().length==0){
return new this._ParseResult(null,_5af,this._ParseResult.CLOSING_PAREN);
}else{
return new this._ParseResult(this._stringToMcoArgument(arg,_5ab,_5ac),_5af,this._ParseResult.CLOSING_PAREN);
}
}else{
arg+=c;
}
}
}
}
}
}
}
if(_5ae==null){
return new this._ParseResult(this._stringToMcoArgument(arg,_5ab,_5ac),args.length-1,this._ParseResult.END_OF_STRING);
}else{
_5ae._terminatingIndex=args.length-1;
_5ae._parseStatus=this._ParseResult.END_OF_STRING;
return _5ae;
}
};
xap.session.DeclarativeArgumentParser.prototype._parseArguments=function(_5ba,_5bb,_5bc,_5bd){
if(this._log.isTrace()){
this._log.trace("Parse arguments: "+_5ba+" at index "+_5bc);
}
var args=new Array();
var _5bf=_5bc-1;
while(true){
var _5c0=this.parseArgument(_5ba,_5bf+1,_5bb,_5bd);
if(this._log.isTrace()){
this._log.trace("Got back result "+_5c0._resultObject);
}
if(_5c0._resultObject!=null){
args.push(_5c0._resultObject);
_5bf=_5c0._terminatingIndex;
if(_5c0._parseStatus==this._ParseResult.CLOSING_PAREN){
break;
}
}else{
if(_5c0._parseStatus!=this._ParseResult.CLOSING_PAREN){
throw new xap.util.Exception("Bad paramter string "+_5ba);
}
break;
}
}
if(this._log.isTrace()){
this._log.trace("Return parse result: "+args);
}
return new this._ParseResult(args,_5bf);
};
xap.session.DeclarativeArgumentParser.prototype._stringToMcoArgument=function(arg,_5c2,_5c3){
arg=arg.trim();
if(arg.indexOf(":")!=-1){
var _5c4=arg.indexOf(":");
var _5c5=arg.substring(0,_5c4);
var _5c6=arg.substring(_5c4+1);
var _5c7=this._session.getContainer(_5c5);
if(!_5c7){
throw new xap.util.Exception("No container with name: "+_5c5);
}
var bean=_5c7.get(_5c6);
if(!bean){
throw new xap.util.Exception("No bean with name: "+_5c6);
}
return bean;
}else{
if(arg=="true"){
return true;
}else{
if(arg=="false"){
return false;
}else{
var num=parseFloat(arg);
if(!isNaN(num)){
return num;
}
}
}
}
if(arg=="event"){
return _5c3;
}
try{
var _5ca=arg;
var _5cb=null;
if(arg.indexOf(".")>0){
_5ca=arg.substring(0,arg.indexOf("."));
_5cb=arg.substring(arg.indexOf(".")+1);
}
var _5cc=this._session.getDocumentContainer().getUiDocument().getElementById(_5ca);
if(!_5cc&&_5ca=="this"){
_5cc=_5c2;
}
if(_5cc){
if(!_5cb){
return _5cc;
}
var _5cd=_5cc.getAttribute(_5cb);
if(!_5cd){
_5cd="";
}
return _5cd;
}
}
catch(e){
_session.handleException(e);
}
throw new xap.util.Exception("Could not convert to mco arg:"+arg);
};
xap.session.DeclarativeArgumentParser.prototype._fireObjectEvent=function(_5ce,_5cf,_5d0,args){
var _5d2=this._session.getSystemContainer();
if((typeof _5ce)!="undefined"&&_5ce!=null&&_5ce.length>0){
_5d2=this._session.getContainer(_5ce);
}
if(_5d2==null){
throw new xap.util.Exception("Could not find container: "+_5ce);
}
var o=_5d2.get(_5cf);
if(o==null){
throw new xap.util.Exception("Could not find object: "+_5cf);
}
if(!o[_5d0]){
throw new xap.util.Exception("Could not find method: "+_5d0);
}
if(this._log.isTrace()){
xap.session.DeclarativeArgumentParser.s_log.debug("Fire object event ["+_5d0+"] on the object "+_5cf+" with arguments "+args);
}
try{
return o[_5d0].apply(o,args);
}
catch(exception){
throw new xap.util.Exception("Error calling method :"+_5d0,exception);
}
return null;
};
xap.session.DeclarativeArgumentParser.prototype._parseString=function(args,_5d5,_5d6){
if(this._log.isTrace()){
this._log.trace("Parse string :"+args+" at start index "+_5d5);
}
var _5d7=new this._ParseResult(null,_5d5);
var arg=new String();
_5d5++;
var _5d9=_5d6=="\""?xap.session.DeclarativeArgumentParser.s_stringArgumentParser:xap.session.DeclarativeArgumentParser.s_stringApostropheArgumentParser;
for(var _5da=_5d5;_5da<args.length;_5da++){
var c=args.charAt(_5da);
if(c==_5d6){
_5d7._resultObject=arg;
_5d7._terminatingIndex=_5da;
break;
}else{
var _5dc=_5d9.getResolvedCharacter(args,_5da);
if(_5dc===xap.util.EscapeSyntaxParser.UNRESOLVED_CHARACTER){
arg+=c;
}else{
arg+=_5dc;
_5da++;
}
}
}
if(_5d7._resultObject==null){
throw new xap.util.Exception("Bad string that we parsed: "+args+" at index "+_5d5--);
}
return _5d7;
};
xap.session.DeclarativeArgumentParser.prototype.addFunctionShortcut=function(_5dd,_5de){
this._functionShortcuts.put(_5dd,_5de);
};
xap.session.DeclarativeArgumentParser.prototype._ParseResult=function(_5df,_5e0,_5e1){
this._resultObject=_5df;
this._terminatingIndex=_5e0;
this._parseStatus=_5e1;
};
xap.session.DeclarativeArgumentParser.prototype._ParseResult.CLOSING_PAREN=1;
xap.session.DeclarativeArgumentParser.prototype._ParseResult.END_OF_STRING=2;
xap.session.DeclarativeArgumentParser.prototype._ParseResult.NO_INFORMATION=0;
xap.session.DeclarativeArgumentParser.prototype._ParseResult.COMMA_ENCOUNTERED=3;
Xap.provide("xap.requestservice.HttpRequest");
xap.requestservice.HttpRequest=function(url,_5e3){
this._url=url;
this._method=_5e3||"GET";
this._headers={};
this._content=null;
};
xap.requestservice.HttpRequest.prototype.setRequestHeader=function(name,_5e5){
this._headers[name]=_5e5;
};
xap.requestservice.HttpRequest.prototype.getHeader=function(name){
return this._headers[name]||"";
};
xap.requestservice.HttpRequest.prototype.getHeaderNames=function(){
var _5e7=Array();
for(var i in this._headers){
_5e7[_5e7.length]=i;
}
return _5e7;
};
xap.requestservice.HttpRequest.prototype.setContent=function(_5e9){
this._content=_5e9;
};
xap.requestservice.HttpRequest.prototype.getContent=function(){
return this._content;
};
xap.requestservice.HttpRequest.prototype.setRequestMethod=function(_5ea){
this._method=_5ea;
};
xap.requestservice.HttpRequest.prototype.getRequestMethod=function(){
return this._method;
};
xap.requestservice.HttpRequest.prototype.setUri=function(uri){
this._url=uri;
};
xap.requestservice.HttpRequest.prototype.getUri=function(){
return this._url;
};
Xap.provide("xap.util.HttpUtils");
Xap.require("xap.requestservice.HttpRequest");
xap.util.HttpUtils=function(){
};
xap.util.HttpUtils.OK=200;
xap.util.HttpUtils.URI_NA=404;
if(window.XMLHttpRequest){
xap.util.HttpUtils.createHttpRequest=function(){
return new XMLHttpRequest();
};
}else{
xap.util.HttpUtils.createHttpRequest=function(){
return new ActiveXObject("Microsoft.XMLHTTP");
};
}
xap.util.HttpUtils._sendHttpRequest=function(type,url,_5ee,_5ef){
var _5f0=xap.util.HttpUtils.createHttpRequest();
var _5f1=typeof url=="object"&&url.constructor==xap.requestservice.HttpRequest;
if(_5f1){
_5f0.open(url.getRequestMethod()||type,url.getUri(),_5ee?true:false);
var _5f2=url.getHeaderNames();
for(var i=0;i<_5f2.length;i++){
var _5f4=_5f2[i];
var _5f5=url.getHeader(_5f4);
if(_5f5){
_5f0.setRequestHeader(_5f4,_5f5);
}
}
}else{
_5f0.open(type,url,_5ee?true:false);
}
if(_5ee){
_5f0.onreadystatechange=function(){
if(_5f0.readyState==4){
_5ee(_5f0);
}
};
}
if(_5f1){
_5f0.send(url.getContent());
}else{
_5f0.send(_5ef);
}
return _5f0;
};
xap.util.HttpUtils.get=function(url,_5f7){
return xap.util.HttpUtils._sendHttpRequest("GET",url,_5f7);
};
xap.util.HttpUtils.post=function(url,_5f9,_5fa){
return xap.util.HttpUtils._sendHttpRequest("POST",url,_5f9,_5fa);
};
xap.util.HttpUtils.head=function(url,_5fc,_5fd){
return xap.util.HttpUtils._sendHttpRequest("HEAD",url,_5fc,_5fd);
};
xap.util.HttpUtils.pingURI=function(uri){
var _5ff=function(_600){
var _601=false;
if(_600.status==xap.util.HttpUtils.OK){
_601=true;
}
};
return xap.util.HttpUtils._sendHttpRequest("HEAD",url,_5ff);
};
Xap.provide("xap.requestservice.RequestService");
Xap.require("xap.xml.ParserFactory");
Xap.require("xap.util.HttpUtils");
Xap.require("xap.util.Exception");
xap.requestservice.RequestService=function(_602){
this._clientSession=_602;
};
xap.requestservice.RequestService.prototype.retrieveAndProcess=function(url){
var _604=this.retrieve(url);
this._processXmlString(_604.responseText,url);
return _604;
};
xap.requestservice.RequestService.prototype.retrieveStartPage=function(url){
this.retrieveAndProcess(url);
};
xap.requestservice.RequestService.prototype.retrieveAndProcessAsynchronously=function(url,_607){
var self=this;
var _609=function(_60a){
if(_607){
if(_60a.status==xap.util.HttpUtils.OK){
try{
self._processXmlString(_60a.responseText,url);
_607.requestCompleted(url,_60a);
}
catch(e){
_607.requestFailed(url,_60a,e);
}
}else{
_607.requestFailed(url,_60a,new xap.util.Exception("Bad response: "+_60a.status+" - "+_60a.statusText));
}
}
};
xap.util.HttpUtils.get(url,_609);
};
xap.requestservice.RequestService.prototype.retrieve=function(url){
var _60c=xap.util.HttpUtils.get(url);
if(_60c.status!=xap.util.HttpUtils.OK){
var uri=url.getUri?url.getUri():url;
throw new xap.util.Exception("The requested page "+uri+" is not available");
}
return _60c;
};
xap.requestservice.RequestService.prototype.retrieveAsynchronously=function(url,_60f){
var _610=function(_611){
if(_60f){
if(_611.status==xap.util.HttpUtils.OK){
_60f.requestCompleted(url,_611);
}else{
_60f.requestFailed(url,_611,new xap.util.Exception("Bad response: "+_611.status+" - "+_611.statusText));
}
}
};
xap.util.HttpUtils.get(url,_610);
};
xap.requestservice.RequestService.prototype._processXmlString=function(_612,uri){
if(uri.getUri){
uri=uri.getUri();
}
if(!_612||_612.search(/^\s*$/)>=0){
return;
}
var _614=xap.xml.ParserFactory.getParser();
this._clientSession.processDocument(_614.parse(_612,xap.requestservice.RequestService.urlToPath(uri)));
};
xap.requestservice.RequestService.urlToPath=function(url){
var _616=url.indexOf("?");
if(_616>0){
url=url.substring(0,_616);
}
var _616=url.lastIndexOf("/");
if(_616>0){
url=url.substring(0,_616+1);
}else{
url=null;
}
return url;
};
Xap.provide("xap.session.ClientSession");
Xap.require("xap.xml.NamespaceHandlerManager");
Xap.require("xap.xml.DocumentContainer");
Xap.require("xap.util.XapException");
Xap.require("xap.util.Hashtable");
Xap.require("xap.taghandling.PluginRegistryImpl");
Xap.require("xap.taghandling.PluginDocumentHandler");
Xap.require("xap.resolver.ResolutionHandler");
Xap.require("xap.taghandling.AbstractTagImpl");
Xap.require("xap.session.EventHandler");
Xap.require("xap.session.DeclarativeArgumentParser");
Xap.require("xap.session.Container");
Xap.require("xap.requestservice.RequestService");
Xap.require("xap.log.Logger");
xap.session.ClientSession=function(_617){
this._application=_617;
this._namesToContainers=new xap.util.Hashtable();
this._mcoContainer=new xap.session.Container(this);
this.addContainer("mco",this._mcoContainer);
this._macroContainer=new xap.session.Container(this);
this.addContainer("macro",this._macroContainer);
this._documentContainer=new xap.xml.DocumentContainer(this);
this.addContainer("document",this._documentContainer);
this._systemContainer=new xap.session.Container(this);
this._requestService=new xap.requestservice.RequestService(this);
this._eventHandler=new xap.session.EventHandler(this);
this._declarativeArgumentParser=new xap.session.DeclarativeArgumentParser(this);
this._pluginRegistry=new xap.taghandling.PluginRegistryImpl(this);
this._namespaceHandlerManager=new xap.xml.NamespaceHandlerManager(this);
this._resolutionHandler=new xap.resolver.ResolutionHandler(this);
var _618=this._documentContainer.getUiDocument();
this._uiDocumentHandler=new xap.taghandling.PluginDocumentHandler(this,_618,xap.xml.DocumentContainer.UI_DOCUMENT_NAME);
};
xap.session.ClientSession.prototype.getPluginRegistry=function(){
return this._pluginRegistry;
};
xap.session.ClientSession.prototype.getNamespaceHandlerManager=function(){
return this._namespaceHandlerManager;
};
xap.session.ClientSession.prototype.getResolutionHandler=function(){
return this._resolutionHandler;
};
xap.session.ClientSession.prototype.getApplication=function(){
return this._application;
};
xap.session.ClientSession.prototype.getMcoContainer=function(){
return this._mcoContainer;
};
xap.session.ClientSession.prototype.getDocumentContainer=function(){
return this._documentContainer;
};
xap.session.ClientSession.prototype.getSystemContainer=function(){
return this._systemContainer;
};
xap.session.ClientSession.prototype.getMacroContainer=function(){
return this._macroContainer;
};
xap.session.ClientSession.prototype.getRequestService=function(){
return this._requestService;
};
xap.session.ClientSession.prototype.getEventHandler=function(){
return this._eventHandler;
};
xap.session.ClientSession.prototype.getDeclarativeArgumentParser=function(){
return this._declarativeArgumentParser;
};
xap.session.ClientSession.prototype.getContainer=function(name){
return this._namesToContainers.get(name);
};
xap.session.ClientSession.prototype.addContainer=function(name,_61b){
this._namesToContainers.put(name,_61b);
};
xap.session.ClientSession.prototype.handleException=function(_61c){
xap.log.Logger.getLogger("exception").error(xap.util.XapException.exceptionToString(_61c));
};
xap.session.ClientSession.prototype.processDocument=function(doc){
var _61e=this.getNamespaceHandlerManager();
var root=doc.getRootElement();
if(!root){
return;
}
for(var i=0;i<root.childNodes.length;i++){
var _621=root.childNodes[i];
var ns=_621.getNamespaceUri();
if(ns){
_61e.dispatch(_621);
}
}
};
xap.session.ClientSession.prototype.getUiDocumentHandler=function(){
return this._uiDocumentHandler;
};
xap.session.ClientSession.prototype._start=function(){
if(this.getApplication().getConfiguration().pluginFiles){
this._processPluginConfigurationFiles(this.getApplication().getConfiguration().pluginFiles);
}
if(this.getApplication().getConfiguration().pluginClasses){
this._processPluginConfigurationClasses(this.getApplication().getConfiguration().pluginClasses);
}
if(this.getApplication().getConfiguration().element){
this._createInitialDocument(this.getApplication().getConfiguration().toolkitType,this.getApplication().getConfiguration().element);
}
var _623=this.getRequestService();
try{
if(this.getApplication().getConfiguration().startPage){
_623.retrieveStartPage(this.getApplication().getConfiguration().startPage);
}
}
catch(exception){
this.handleException(exception);
}
};
xap.session.ClientSession.prototype._processPluginConfigurationFiles=function(_624){
var _625=this.getRequestService();
for(var i=0;i<_624.length;i++){
var _627=_624[i];
var _628=this.getApplication().getConfiguration().context+_627;
var _629=_625.retrieve(_628);
this._pluginRegistry.addPluginDescription(_629.responseText,_628);
}
};
xap.session.ClientSession.prototype._processPluginConfigurationClasses=function(_62a){
for(var i=0;i<_62a.length;i++){
var _62c=_62a[i];
this._pluginRegistry.loadLifecycleObject(_62c);
}
};
xap.session.ClientSession.prototype._createInitialDocument=function(_62d,_62e){
var _62f="xap.bridges.basic.HtmlHostBridge";
Xap.require(_62f);
var _630=new xap.bridges.basic.HtmlHostBridge();
var _631=this.getDocumentContainer().getUiDocument();
_630.setElement(_631.getRootElement());
_630.setSession(this);
_630.init();
_630.createHost(_62e,_62d);
this.getUiDocumentHandler().setHandlerForElement(_630.getElement(),_630);
_631.getRootElement().addStructureChangeListener(_630);
};
Xap.provide("xap.application.Application");
Xap.require("xap.util.Exception");
Xap.require("xap.session.ClientSession");
Xap.require("xap.log.Logger");
xap.application.Application=function(_632){
if(_632!=null){
this._applicationConfig=_632;
}else{
this._applicationConfig={};
}
};
xap.application.Application.prototype.create=function(){
this._processConfiguration();
if(this._applicationConfig==null){
throw new xap.util.Exception(" bad argument, no configuration object supplied to the Xap.createApplication",null,null,"xap.application.Application.prototype.create");
}
var _633=xap.util.ArrayHelper.indexOf(xap.log.Logger.LEVEL_NAMES,this._applicationConfig.logLevel);
if(_633>=0){
xap.log.Logger.getRootLogger().setLevel(_633);
}
var _634=this._applicationConfig.logAppenders;
if(_634){
for(var i=0;i<_634.length;i++){
xap.log.Logger.getRootLogger().addAppender(eval("new "+_634[i]+"();"));
}
}
if(this._applicationConfig.context==null){
this._applicationConfig.context="../../";
}
if(this._applicationConfig.srcPath==null){
this._applicationConfig.srcPath="../../";
}
this._session=new xap.session.ClientSession(this);
this._session._start();
};
xap.application.Application.prototype.getSession=function(){
return this._session;
};
xap.application.Application.prototype.getConfiguration=function(){
return this._applicationConfig;
};
xap.application.Application.prototype.fireEvent=function(_636){
var _637=new xap.session.ClientEvent(null,this.getSession());
return this._session.getEventHandler().fireEvent("",_636,null,_637);
};
xap.application.Application.prototype._processConfiguration=function(){
if(this._applicationConfig.configFilePath==null){
if(this._applicationConfig.context!=null){
this._applicationConfig.configFilePath=this._applicationConfig.context+"XapConfig.js";
}else{
this._applicationConfig.configFilePath="../../XapConfig.js";
}
}
var _638=new xap.requestservice.RequestService(null);
var _639=_638.retrieve(this._applicationConfig.configFilePath).responseText;
if(_639&&_639!=null){
var _63a=eval("("+_639+")");
for(property in _63a){
if(!this._applicationConfig[property]){
this._applicationConfig[property]=_63a[property];
}
}
}
};
Xap.provide("xap.html.HtmlConnector");
xap.html.HtmlConnector=function(){
};
xap.html.HtmlConnector._findAppElements=function(){
var _63b=new google.ExprContext(document);
var _63c=google.xpathParse("//");
var _63d=_63c.evaluate(_63b);
var _63e=_63d.nodeSetValue();
return _63e;
};
xap.html.HtmlConnector.xapletCount=0;
xap.html.HtmlConnector.getNextXapLabel=function(){
return "xapApplication_"+(++xap.html.HtmlConnector.xapApplication);
};
xap.html.HtmlConnector.APPLICATION_CONTEXT_ATTRIBUTE__NAME="context";
xap.html.HtmlConnector.APPLICATION_SRC_PATH_ATTRIBUTE__NAME="srcPath";
xap.html.HtmlConnector.APPLICATION_ID_ATTRIBUTE__NAME="applicationName";
xap.html.HtmlConnector.APPLICATION_SOURCE_ATTRIBUTE__NAME="startPage";
xap.html.HtmlConnector.APPLICATION_TOOLKIT_ATTRIBUTE__NAME="toolkitType";
xap.html.HtmlConnector.APPLICATION_CONFIGFILEPATH_ATTRIBUTE__NAME="configFilePath";
xap.html.HtmlConnector.APPLICATION_CONTEXT_DEFAULT=null;
xap.html.HtmlConnector.APPLICATION_TOOLKITTYPE_DEFAULT="dojo";
xap.html.HtmlConnector.APPLICATION_CONFIGFILEPATH_DEFAULT=null;
xap.html.HtmlConnector.scanPage=function(){
var _63f=xap.html.HtmlConnector._findAppElements();
if(window.xapApplications==null){
window.xapApplications=new Array(0);
}
if(Xap.embeddedApplications==null){
Xap.embeddedApplications=new Array(0);
}
for(var i=0;i<_63f.length;++i){
var _641=_63f[i];
if(!_641.getAttribute){
continue;
}
var _642=_641.getAttribute(xap.html.HtmlConnector.APPLICATION_SOURCE_ATTRIBUTE__NAME);
if(!_642){
continue;
}
var _643=_641.getAttribute(xap.html.HtmlConnector.APPLICATION_ID_ATTRIBUTE__NAME);
if(!_643){
_643=xap.html.HtmlConnector.getNextXapLabel();
}
var _644=_641.getAttribute(xap.html.HtmlConnector.APPLICATION_CONTEXT_ATTRIBUTE__NAME);
if(_644==null){
_644=xap.html.HtmlConnector.APPLICATION_CONTEXT_DEFAULT;
}
var _645=_641.getAttribute(xap.html.HtmlConnector.APPLICATION_SRC_PATH_ATTRIBUTE__NAME);
if(_645==null){
_645=xap.html.HtmlConnector.APPLICATION_CONTEXT_DEFAULT;
}
var _646=_641.getAttribute(xap.html.HtmlConnector.APPLICATION_CONFIGFILEPATH_ATTRIBUTE__NAME);
if(_646==null){
_646=xap.html.HtmlConnector.APPLICATION_CONFIGFILEPATH_DEFAULT;
}
var _647=_641.getAttribute(xap.html.HtmlConnector.APPLICATION_TOOLKIT_ATTRIBUTE__NAME);
if(_647==null){
_647=xap.html.HtmlConnector.APPLICATION_TOOLKITTYPE_DEFAULT;
}
var _648={applicationName:_643,startPage:_642,context:_644,srcPath:_645,scanPage:false,element:_641,configFilePath:_646};
Xap.embeddedApplications.push(_648);
}
};
xap.html.HtmlConnector.createEmbeddedApplications=function(){
for(var j=0;j<Xap.embeddedApplications.length;++j){
var _64a=Xap.embeddedApplications[j];
var app=Xap.createApplication(_64a);
window.xapApplications[_64a.applicationName]=app;
}
};
Xap.provide("xap.xml.xmodify.XmodifyException");
xap.xml.xmodify.XmodifyException=function(){
var _64c=arguments[0];
for(var i=1;i<arguments.length;i++){
_64c=_64c.replace("%s",arguments[i]);
}
this._message=_64c;
};
xap.xml.xmodify.XmodifyException.prototype.toString=function(){
return this._message;
};
xap.xml.xmodify.XmodifyException.SET_ROOT_ELEMENT_EXPECTS_ONE_ARG="setRootElement() expects one argument";
xap.xml.xmodify.XmodifyException.COMMAND_EXPECTS_TARGETS="Command %s expects target node(s)";
xap.xml.xmodify.XmodifyException.COMMAND_EXPECTS_ONE_ARG="Command %s expects exactly one argument";
xap.xml.xmodify.XmodifyException.INVALID_NODE_FOR_COMMAND="Invalid node %s for command %s";
xap.xml.xmodify.XmodifyException.ATTRIBUTE_ARGUMENT_NOT_ATTRIB_DIRECTIVE="Attribute argument (%s) is not an attribute directive!";
xap.xml.xmodify.XmodifyException.UNKNOWN_COMMAND="Directive %s is unrecognized";
xap.xml.xmodify.XmodifyException.INVALID_INSERT_AFTER_BECAUSE_OF_PARENT="The XPath statement resolved to type %s which does not have a parent. Therefore an insert after cannot be performed.";
xap.xml.xmodify.XmodifyException.INVALID_INSERT_BEFORE_BECAUSE_OF_PARENT="The XPath statement resolved to type %s which does not have a parent. Therefore an insert before cannot be performed.";
xap.xml.xmodify.XmodifyException.CHILDREN_CANT_BE_ADDED="The XPath statement returned a node to which children may not be added: %s";
xap.xml.xmodify.XmodifyException.CANNOT_REPLACE="Some problem replacing node <%s/> with node <%s/>:  %s";
xap.xml.xmodify.XmodifyException.CANNOT_REPLACE__REMOVAL="Some problem removing old node <%s/>: %s";
xap.xml.xmodify.XmodifyException.CANNOT_REPLACE__INSERTION="Some problem inserting new node <%s/>: %s";
xap.xml.xmodify.XmodifyException.CANNOT_REPLACE__ORIGINAL_INVALID="Can't replace the selected element with the indicated element, the selected element was null or otherwise not an XNode instance: %s.";
xap.xml.xmodify.XmodifyException.ZERO_RESULTS="The XPath statement %s returned 0 results.";
xap.xml.xmodify.XmodifyException.UNSPECIFIED_EXCEPTION="Unspecified xap.xml.xmodify.Xmodify exception.";
Xap.provide("xap.xml.xmodify.UpdateDirective");
Xap.require("xap.xml.xmodify.XmodifyException");
xap.xml.xmodify.UpdateDirective=function(){
};
xap.xml.xmodify.UpdateDirective.DIRECTIVE_VARIABLE=0;
xap.xml.xmodify.UpdateDirective.DIRECTIVE_ATTRIBUTE=1;
xap.xml.xmodify.UpdateDirective.DIRECTIVE_VALUE_OF=2;
xap.xml.xmodify.UpdateDirective.DIRECTIVE_INSERT_AFTER=3;
xap.xml.xmodify.UpdateDirective.DIRECTIVE_INSERT_BEFORE=4;
xap.xml.xmodify.UpdateDirective.DIRECTIVE_APPEND=5;
xap.xml.xmodify.UpdateDirective.DIRECTIVE_SET_ATTRIBUTE=6;
xap.xml.xmodify.UpdateDirective.DIRECTIVE_REPLACE=7;
xap.xml.xmodify.UpdateDirective.DIRECTIVE_REPLACE_CHILDREN=8;
xap.xml.xmodify.UpdateDirective.DIRECTIVE_REMOVE_ELEMENT=9;
xap.xml.xmodify.UpdateDirective.DIRECTIVE_REMOVE_ATTRIBUTE=10;
xap.xml.xmodify.UpdateDirective.DIRECTIVE_INSERT_AT=11;
xap.xml.xmodify.UpdateDirective.DIRECTIVE_CLONE=12;
xap.xml.xmodify.UpdateDirective.DIRECTIVE_CREATE_DOCUMENT=13;
xap.xml.xmodify.UpdateDirective.DIRECTIVE_EMBED_XAL=14;
xap.xml.xmodify.UpdateDirective.DIRECTIVE_SET_INNER_HTML=15;
xap.xml.xmodify.UpdateDirective.DIRECTIVE_SET_STYLE=16;
xap.xml.xmodify.UpdateDirective.DIRECTIVE_STYLE=17;
xap.xml.xmodify.UpdateDirective.DIRECTIVE_NAMES=[];
xap.xml.xmodify.UpdateDirective.DIRECTIVE_NAMES[xap.xml.xmodify.UpdateDirective.DIRECTIVE_VARIABLE]="variable";
xap.xml.xmodify.UpdateDirective.DIRECTIVE_NAMES[xap.xml.xmodify.UpdateDirective.DIRECTIVE_ATTRIBUTE]="attribute";
xap.xml.xmodify.UpdateDirective.DIRECTIVE_NAMES[xap.xml.xmodify.UpdateDirective.DIRECTIVE_VALUE_OF]="value-of";
xap.xml.xmodify.UpdateDirective.DIRECTIVE_NAMES[xap.xml.xmodify.UpdateDirective.DIRECTIVE_INSERT_AFTER]="insert-after";
xap.xml.xmodify.UpdateDirective.DIRECTIVE_NAMES[xap.xml.xmodify.UpdateDirective.DIRECTIVE_INSERT_BEFORE]="insert-before";
xap.xml.xmodify.UpdateDirective.DIRECTIVE_NAMES[xap.xml.xmodify.UpdateDirective.DIRECTIVE_APPEND]="append";
xap.xml.xmodify.UpdateDirective.DIRECTIVE_NAMES[xap.xml.xmodify.UpdateDirective.DIRECTIVE_SET_ATTRIBUTE]="set-attribute";
xap.xml.xmodify.UpdateDirective.DIRECTIVE_NAMES[xap.xml.xmodify.UpdateDirective.DIRECTIVE_REPLACE]="replace";
xap.xml.xmodify.UpdateDirective.DIRECTIVE_NAMES[xap.xml.xmodify.UpdateDirective.DIRECTIVE_REPLACE_CHILDREN]="replace-children";
xap.xml.xmodify.UpdateDirective.DIRECTIVE_NAMES[xap.xml.xmodify.UpdateDirective.DIRECTIVE_REMOVE_ELEMENT]="remove-element";
xap.xml.xmodify.UpdateDirective.DIRECTIVE_NAMES[xap.xml.xmodify.UpdateDirective.DIRECTIVE_REMOVE_ATTRIBUTE]="remove-attribute";
xap.xml.xmodify.UpdateDirective.DIRECTIVE_NAMES[xap.xml.xmodify.UpdateDirective.DIRECTIVE_INSERT_AT]="insert-at";
xap.xml.xmodify.UpdateDirective.DIRECTIVE_NAMES[xap.xml.xmodify.UpdateDirective.DIRECTIVE_CLONE]="clone";
xap.xml.xmodify.UpdateDirective.DIRECTIVE_NAMES[xap.xml.xmodify.UpdateDirective.DIRECTIVE_CREATE_DOCUMENT]="create-document";
xap.xml.xmodify.UpdateDirective.DIRECTIVE_NAMES[xap.xml.xmodify.UpdateDirective.DIRECTIVE_EMBED_XAL]="embed-xal";
xap.xml.xmodify.UpdateDirective.DIRECTIVE_NAMES[xap.xml.xmodify.UpdateDirective.DIRECTIVE_SET_INNER_HTML]="set-innerhtml";
xap.xml.xmodify.UpdateDirective.DIRECTIVE_NAMES[xap.xml.xmodify.UpdateDirective.DIRECTIVE_SET_STYLE]="set-style";
xap.xml.xmodify.UpdateDirective.DIRECTIVE_NAMES[xap.xml.xmodify.UpdateDirective.DIRECTIVE_STYLE]="style";
xap.xml.xmodify.UpdateDirective.getType=function(_64e){
for(var i=0;i<xap.xml.xmodify.UpdateDirective.DIRECTIVE_NAMES.length;i++){
if(xap.xml.xmodify.UpdateDirective.DIRECTIVE_NAMES[i]==_64e){
return (i);
}
}
throw (new xap.xml.xmodify.XmodifyException(xap.xml.xmodify.XmodifyException.UNKNOWN_COMMAND,_64e));
};
Xap.provide("xap.bridges.basic.HtmlHostBridge");
Xap.require("xap.taghandling.AbstractTagImpl");
xap.bridges.basic.HtmlHostBridge=function(){
xap.taghandling.AbstractTagImpl.call(this);
};
Xap.setupClassAsSubclassOf("xap.bridges.basic.HtmlHostBridge","xap.taghandling.AbstractTagImpl");
xap.bridges.basic.HtmlHostBridge.prototype.toString=function(){
return "xap.bridges.basic.HtmlHostBridge";
};
xap.bridges.basic.HtmlHostBridge.prototype.init=function(){
var _650=this.getElement();
this.parseInitialAttributes(_650);
if(_650&&_650.getAttribute("htmlElementId")){
this.createPeer(_650.getAttribute("htmlElementId"));
var _651=this.getSession().getUiDocumentHandler();
var _652=this.getElement().childNodes;
if(!xap.taghandling.AbstractTagImpl.TAIL_RECURSION){
for(var i=0;i<_652.length;i++){
if(_652[i].nodeType==google.DOM_ELEMENT_NODE){
_651.parseChild(_652[i]);
}
}
}
}
};
xap.bridges.basic.HtmlHostBridge.prototype.createPeer=function(_654){
var _655=document.getElementById(_654);
this.createHost(_655,"dojo");
};
xap.bridges.basic.HtmlHostBridge.prototype.createHost=function(_656,_657){
var _658=null;
if(_657&&_657=="dojo"){
_658=(_656!=null)?_656:document.body;
}
this.setPeer(_658);
};
xap.bridges.basic.HtmlHostBridge.prototype.childAdded=function(e){
var _65a=e.getChange();
var _65b=this.getUiContentHandler().getHandlerForElement(_65a);
this.addChild(_65b,e.getIndex());
};
xap.bridges.basic.HtmlHostBridge.prototype.addChild=function(_65c,_65d){
if(_65c.getRootDomNode){
this.getRootDomNode().appendChild(_65c.getRootDomNode());
}
};
xap.bridges.basic.HtmlHostBridge.prototype.getRootDomNode=function(){
return this.getPeer();
};
Xap.provide("xap.xml.xmodify.CommandDirective");
Xap.require("xap.log.Logger");
Xap.require("xap.xml.xmodify.XmodifyException");
Xap.require("xap.xml.xmodify.UpdateDirective");
Xap.require("xap.xml.dom.Document");
Xap.require("xap.util.MessageFormat");
Xap.require("xap.util.XapException");
Xap.require("google.xpath");
xap.xml.xmodify.CommandDirective=function(_65e,_65f,_660){
this._type=xap.xml.xmodify.UpdateDirective.getType(_65e.getLocalName());
this._commandArguments=_65e.childNodes;
this._nameAttr=_65e.getAttribute("name");
this._selectAttr=_65e.getAttribute("select");
this._cloneAttr=_65e.getAttribute("clone");
this._indexAttr=_65e.getAttribute("index");
var _661=xap.xml.xmodify.CommandDirective.checkArguments(this._type,this._commandArguments.length);
if(_661!==null){
throw (_661);
}
this._session=_65f;
this._directiveSet=_660;
this._log=xap.xml.xmodify.CommandDirective.s_log;
};
xap.xml.xmodify.CommandDirective.s_log=xap.log.Logger.getLogger("xap.xml.xmodify.Xmodify");
xap.xml.xmodify.CommandDirective.isTargetExpected=function(_662){
var _663=(_662!=xap.xml.xmodify.UpdateDirective.DIRECTIVE_CREATE_DOCUMENT);
return (_663);
};
xap.xml.xmodify.CommandDirective.checkArguments=function(_664,_665){
if((_665===0)&&(_664==xap.xml.xmodify.UpdateDirective.DIRECTIVE_SET_ATTRIBUTE)){
return new xap.xml.xmodify.XmodifyException(xap.xml.xmodify.XmodifyException.COMMAND_EXPECTS_ONE_ARG,"set-attribute");
}
return (null);
};
xap.xml.xmodify.CommandDirective.replaceElement=function(_666,_667){
if((!_666)||(!_666.parentNode)){
return;
}
var _668=_666.parentNode;
var _669=_666.nextSibling;
_668.removeChild(_666);
var n=null;
if(_669){
for(n=0;n<_667.length;n++){
_668.insertBefore(_667[n],_669);
}
}else{
for(n=0;n<_667.length;n++){
_668.appendChild(_667[n]);
}
}
};
xap.xml.xmodify.CommandDirective.insertElement=function(_66b,_66c,_66d){
if((!_66b)||(!_66b.parentNode)){
return;
}
var _66e=_66b.parentNode;
var n=null;
if(_66d){
for(n=0;n<_66c.length;n++){
_66e.insertBefore(_66c[n],_66b);
}
}else{
if(_66b.nextSibling){
for(n=0;n<_66c.length;n++){
_66e.insertBefore(_66c[n],_66b.nextSibling);
}
}else{
for(n=0;n<_66c.length;n++){
_66e.appendChild(_66c[n]);
}
}
}
};
xap.xml.xmodify.CommandDirective.selectMatchingNodes=function(_670,_671){
var _672=[];
if(_671&&(_671.charAt(0)=="#")){
var id=_671.substring(1);
var _674=_670.getElementById(id);
if(_674){
_672.push(_674);
}
}else{
var _675=google.xpathParse(_671);
var _676=new google.ExprContext(_670);
var _677=_675.evaluate(_676);
_672=_677.nodeSetValue();
}
return _672;
};
xap.xml.xmodify.CommandDirective.prototype.execute=function(_678,_679){
var _67a=xap.xml.xmodify.CommandDirective.selectMatchingNodes(_678,this._selectAttr);
var _67b=(_678 instanceof xap.xml.dom.Document);
if((_67a.length===0)&&xap.xml.xmodify.CommandDirective.isTargetExpected(this.getType())){
var ex=new xap.xml.xmodify.XmodifyException(xap.xml.xmodify.XmodifyException.ZERO_RESULTS,this._selectAttr);
if(this._log.isDebug()){
this._log.debug(xap.util.XapException.exceptionToString(ex));
}
return;
}
switch(this.getType()){
case xap.xml.xmodify.UpdateDirective.DIRECTIVE_VARIABLE:
this._handleVariable(_678,_67a,(this._cloneAttr&&this._cloneAttr=="true"));
break;
case xap.xml.xmodify.UpdateDirective.DIRECTIVE_APPEND:
this._handleAppend(_678,_67a);
break;
case xap.xml.xmodify.UpdateDirective.DIRECTIVE_SET_ATTRIBUTE:
this._handleSetAttribute(_678,_679,_67a);
break;
case xap.xml.xmodify.UpdateDirective.DIRECTIVE_REMOVE_ELEMENT:
this._handleRemoveElement(_678,_67a);
break;
case xap.xml.xmodify.UpdateDirective.DIRECTIVE_REMOVE_ATTRIBUTE:
this._handleRemoveAttribute(_678,_67a);
break;
case xap.xml.xmodify.UpdateDirective.DIRECTIVE_INSERT_BEFORE:
this._handleInsert(_678,_67a,true);
break;
case xap.xml.xmodify.UpdateDirective.DIRECTIVE_INSERT_AFTER:
this._handleInsert(_678,_67a,false);
break;
case xap.xml.xmodify.UpdateDirective.DIRECTIVE_INSERT_AT:
this._handleInsertAt(_678,_67a);
break;
case xap.xml.xmodify.UpdateDirective.DIRECTIVE_REPLACE:
this._handleReplace(_678,_67a);
break;
case xap.xml.xmodify.UpdateDirective.DIRECTIVE_REPLACE_CHILDREN:
this._handleReplaceChildren(_678,_67a);
break;
case xap.xml.xmodify.UpdateDirective.DIRECTIVE_CLONE:
this._handleClone(_678,_67a);
break;
case xap.xml.xmodify.UpdateDirective.DIRECTIVE_EMBED_XAL:
this._handleEmbedXal(_678,_67a);
break;
case xap.xml.xmodify.UpdateDirective.DIRECTIVE_SET_INNER_HTML:
this._handleSetInnerHtml(_678,_67a);
break;
case xap.xml.xmodify.UpdateDirective.DIRECTIVE_SET_STYLE:
this._handleSetStyle(_678,_679,_67a);
break;
default:
if(this._log.isDebug()){
var _67d=xap.util.MessageFormat.format("Unhandled command : {0}",[this.getType()]);
this._log.debug(_67d);
}
}
};
xap.xml.xmodify.CommandDirective.prototype._handleVariable=function(_67e,_67f,_680){
if(!this._nameAttr){
this._log.debug("Variable element requires a name.");
return;
}
if(!this._directiveSet.variables){
this._directiveSet.variables={};
}
var _681=[];
for(var n=0;n<_67f.length;n++){
var _683=_67f[n];
this._log.debug("Variable node: "+_683.nodeName);
_681.push(_683);
}
_681.needClone=_680;
this._directiveSet.variables[this._nameAttr]=_681;
};
xap.xml.xmodify.CommandDirective.prototype._handleAppend=function(_684,_685){
var _686=this._commandArguments;
if(this._log.isDebug()){
var _687=xap.util.MessageFormat.format("We have {0} children to append to {1}:{2}",[_686.length,this._selectAttr,this.formatDocument(_684)]);
this._log.debug(_687);
}
for(var i=0;i<_685.length;i++){
var _689=_685[i];
if(_689.nodeType==google.DOM_DOCUMENT_NODE){
if(this._log.isDebug()){
this._log.debug("We have 1 elem to append as new root : "+_686[0]);
}
if(_686.length!=1){
throw new xap.xml.xmodify.XmodifyException(xap.xml.xmodify.XmodifyException.SET_ROOT_ELEMENT_EXPECTS_ONE_ARG);
}else{
_689.setRootElement(_686[0]);
return;
}
}else{
if(_689.nodeType==google.DOM_ELEMENT_NODE){
for(var j=0;j<_686.length;j++){
try{
var _68b=this._createNode(_684,_686[j]);
var _68c=xap.util.MessageFormat.format("Appending {0} nodes to {1}",[_68b.length,_689.nodeName]);
this._log.debug(_68c);
for(var k=0;k<_68b.length;k++){
_689.appendChild(_68b[k]);
}
}
catch(e){
if(this._log.isDebug()){
this._log.debug("Exception: "+e.message);
}
}
}
}else{
throw new xap.xml.xmodify.XmodifyException(xap.xml.xmodify.XmodifyException.INVALID_NODE_FOR_COMMAND,_689.nodeType,"append");
}
}
}
};
xap.xml.xmodify.CommandDirective.prototype._handleSetAttribute=function(_68e,_68f,_690){
if((!_690.length)||(_690.length===0)){
throw new xap.xml.xmodify.XmodifyException(xap.xml.xmodify.XmodifyException.COMMAND_EXPECTS_TARGETS,"set-attribute");
}
var _691=this._commandArguments;
for(var i=0;i<_690.length;i++){
var _693=_690[i];
if(_693.nodeType==google.DOM_ELEMENT_NODE){
for(var j=0;j<_691.length;j++){
var _695=_691[j];
if(_695.getLocalName&&(_695.getLocalName()==xap.xml.xmodify.UpdateDirective.DIRECTIVE_NAMES[xap.xml.xmodify.UpdateDirective.DIRECTIVE_ATTRIBUTE])){
var name=_695.getAttribute("name");
var _697=_695.getAttribute("value");
_693.setAttribute(name,_697,_68f);
}else{
throw new xap.xml.xmodify.XmodifyException(xap.xml.xmodify.XmodifyException.ATTRIBUTE_ARGUMENT_NOT_ATTRIB_DIRECTIVE,_695.nodeName);
}
}
}else{
throw new xap.xml.xmodify.XmodifyException(xap.xml.xmodify.XmodifyException.INVALID_NODE_FOR_COMMAND,_693.nodeType,"set-attribute");
}
}
};
xap.xml.xmodify.CommandDirective.prototype._handleReplaceChildren=function(_698,_699){
var _69a=this._commandArguments;
for(var i=0;i<_699.length;i++){
var node=_699[i];
if(node.nodeType!=google.DOM_ELEMENT_NODE){
continue;
}
while(node.childNodes.length>0){
node.removeChild(node.childNodes[0]);
}
for(var j=0;j<_69a.length;j++){
var _69e=this._createNode(_698,_69a[j]);
for(var k=0;k<_69e.length;k++){
node.appendChild(_69e[k]);
}
}
}
};
xap.xml.xmodify.CommandDirective.prototype._handleRemoveElement=function(_6a0,_6a1){
if((!_6a1.length)||(_6a1.length===0)){
throw new xap.xml.xmodify.XmodifyException(xap.xml.xmodify.XmodifyException.COMMAND_EXPECTS_TARGETS,"remove");
}
var _6a2=this._selectAttr;
if(this._log.isDebug()){
var _6a3=xap.util.MessageFormat.format("Removing the element at XPath {0} : results : {1}",[_6a2,_6a1.length]);
this._log.debug(_6a3);
}
for(var i=0;i<_6a1.length;i++){
var _6a5=_6a1[i];
if(!_6a5){
continue;
}
switch(_6a5.nodeType){
case (google.DOM_ELEMENT_NODE):
if(_6a5.parentNode){
_6a5.parentNode.removeChild(_6a5);
}else{
if(_6a5===_6a0.getRootElement()){
_6a0.setRootElement(null);
return;
}else{
}
}
break;
case (google.DOM_TEXT_NODE):
var _6a6=xap.util.MessageFormat.format("Removing text node ({0})",[_6a5.nodeValue()]);
if(this._log.isDebug()){
this._log.debug(_6a6);
}
if(_6a5.parentNode){
_6a5.parentNode.removeChild(_6a5);
}
break;
default:
throw new xap.xml.xmodify.XmodifyException(xap.xml.xmodify.XmodifyException.INVALID_NODE_FOR_COMMAND,_6a5.nodeName,"remove-element");
}
}
};
xap.xml.xmodify.CommandDirective.prototype._handleRemoveAttribute=function(_6a7,_6a8){
if((!_6a8.length)||(_6a8.length===0)){
throw new xap.xml.xmodify.XmodifyException(xap.xml.xmodify.XmodifyException.COMMAND_EXPECTS_TARGETS,"remove-attriute");
}
var _6a9=this._commandArguments;
for(var i=0;i<_6a8.length;i++){
var _6ab=_6a8[i];
if(_6ab.nodeType==google.DOM_ELEMENT_NODE){
for(var j=0;j<_6a9.length;j++){
var _6ad=_6a9[j];
if(_6ad.getLocalName&&(_6ad.getLocalName()==xap.xml.xmodify.UpdateDirective.DIRECTIVE_NAMES[xap.xml.xmodify.UpdateDirective.DIRECTIVE_ATTRIBUTE])){
var name=_6ad.getAttribute("name");
_6ab.removeAttribute(name);
}else{
throw new xap.xml.xmodify.XmodifyException(xap.xml.xmodify.XmodifyException.ATTRIBUTE_ARGUMENT_NOT_ATTRIB_DIRECTIVE,_6ad.nodeName);
}
}
}else{
throw new xap.xml.xmodify.XmodifyException(xap.xml.xmodify.XmodifyException.INVALID_NODE_FOR_COMMAND,"remove-attribute",_6ab.nodeType);
}
}
if(this._log.isDebug()){
this._log.debug("Completed remove-attribute: "+this.formatDocument(_6a7));
}
};
xap.xml.xmodify.CommandDirective.prototype._handleInsert=function(_6af,_6b0,_6b1){
var _6b2=this._commandArguments;
for(var i=0;i<_6b0.length;i++){
var _6b4=_6b0[i];
var _6b5=[];
if((!_6b4)||(!_6b4.parentNode)){
this._log.debug("Node undefined or does not have a parent node");
continue;
}
if(_6b4.nodeType==google.DOM_ATTRIBUTE_NODE){
this._log.debug("Can't insert non-attribute node before an attribute node");
continue;
}
if(_6b4.nodeType==google.DOM_ELEMENT_NODE||_6b4.nodeType==google.DOM_TEXT_NODE){
for(var j=0;j<_6b2.length;j++){
var _6b7=this._createNode(_6af,_6b2[j]);
for(var k=0;k<_6b7.length;k++){
_6b5.push(_6b7[k]);
}
}
xap.xml.xmodify.CommandDirective.insertElement(_6b4,_6b5,_6b1);
}else{
this._log.debug("Can't do insert before for this type of node");
continue;
}
}
};
xap.xml.xmodify.CommandDirective.prototype._handleInsertAt=function(_6b9,_6ba){
var _6bb=parseInt(this._indexAttr,10);
if((!_6bb)||(typeof (_6bb)!="number")){
throw new xap.xml.xmodify.XmodifyException("Expected \"index\" attribute with integer value");
}
if(_6ba.length===0&&_6ba[0].nodeType==google.DOM_DOCUMENT_NODE){
if(this._commandArguments.length!==0){
throw new xap.xml.xmodify.XmodifyException(xap.xml.xmodify.XmodifyException.SET_ROOT_ELEMENT_EXPECTS_ONE_ARG);
}
_6ba[0].setRootElement(this._commandArguments[0]);
return;
}
var _6bc=[];
for(var n=0;n<_6ba.length;n++){
var _6be=_6ba[n].childNodes[_6bb];
if(!_6be){
throw new xap.xml.xmodify.XmodifyException("Index out of range");
}
if(_6be.nodeType!=google.DOM_ELEMENT_NODE){
throw new xap.xml.xmodify.XmodifyException(xap.xml.xmodify.XmodifyException.INVALID_NODE_FOR_COMMAND,_6be.nodeType,"insert-at");
}
_6bc.push(_6be);
}
this._handleInsert(_6b9,_6bc,true);
};
xap.xml.xmodify.CommandDirective.prototype._handleReplace=function(_6bf,_6c0){
if((!_6c0.length)||(_6c0.length===0)){
throw new xap.xml.xmodify.XmodifyException(xap.xml.xmodify.XmodifyException.COMMAND_EXPECTS_TARGETS,"replace");
}
var _6c1=this._commandArguments;
var _6c2=[];
for(var i=0;i<_6c0.length;i++){
var _6c4=_6c0[i];
if((!_6c4)){
return;
}
var _6c5=_6c4.parentNode;
if((!_6c5)){
if(_6c1.length!=1||_6c0.length!=1||i!==0){
throw new xap.xml.xmodify.XmodifyException(xap.xml.xmodify.XmodifyException.SET_ROOT_ELEMENT_EXPECTS_ONE_ARG);
}else{
_6bf.setRootElement(_6c1[0]);
return;
}
}
for(var j=0;j<_6c1.length;j++){
var _6c7=this._createNode(_6bf,_6c1[j]);
for(var k=0;k<_6c7.length;k++){
_6c2.push(_6c7[k]);
}
}
xap.xml.xmodify.CommandDirective.replaceElement(_6c4,_6c2);
}
};
xap.xml.xmodify.CommandDirective.prototype._handleClone=function(_6c9,_6ca){
var _6cb=[];
for(var n=0;n<_6ca.length;n++){
var _6cd=_6ca[n];
if(_6cd.nodeType==google.DOM_ELEMENT_NODE){
var _6ce=null;
if(_6cd instanceof google.XNode){
_6ce=_6cd.deepClone();
}else{
var _6cf=this.makeHtmlNode(_6cd);
if(_6cf.length!=0){
_6ce=_6cf[0];
}
}
_6cb[n]=_6ce;
}else{
throw new xap.xml.xmodify.XmodifyException(xap.xml.xmodify.XmodifyException.INVALID_NODE_FOR_COMMAND,"clone",currentNode.nodeType);
}
}
return _6cb;
};
xap.xml.xmodify.CommandDirective.prototype._handleEmbedXal=function(_6d0,_6d1){
Xap.require("xap.bridges.basic.HtmlHostBridge");
var _6d2=this._commandArguments;
var _6d3=this._session.getDocumentContainer().getUiDocument();
for(var i=0;i<_6d1.length;i++){
var _6d5=_6d1[i];
var _6d6=_6d3.createElement("htmlHost","http://openxal.org/ui");
_6d3.getRootElement().appendChild(_6d6);
var _6d7=this._session.getUiDocumentHandler().getHandlerForElement(_6d6);
_6d7.createHost(_6d5,"dojo");
for(var j=0;j<_6d2.length;j++){
_6d6.appendChild(_6d2[j]);
}
}
};
xap.xml.xmodify.CommandDirective.prototype._handleSetInnerHtml=function(_6d9,_6da){
var _6db=this._commandArguments;
for(var i=0;i<_6da.length;i++){
var _6dd=_6da[i];
for(var j=0;j<_6db.length;j++){
if(_6db[j].nodeType==google.DOM_TEXT_NODE&&_6db[j].nodeValue){
_6dd.innerHTML=_6db[j].nodeValue;
}
}
}
};
xap.xml.xmodify.CommandDirective.prototype._handleSetStyle=function(_6df,_6e0,_6e1){
if((!_6e1.length)||(_6e1.length===0)){
throw new xap.xml.xmodify.XmodifyException(xap.xml.xmodify.XmodifyException.COMMAND_EXPECTS_TARGETS,"set-style");
}
var _6e2=this._commandArguments;
for(var i=0;i<_6e1.length;i++){
var _6e4=_6e1[i];
if(_6e4.nodeType==google.DOM_ELEMENT_NODE){
for(var j=0;j<_6e2.length;j++){
var _6e6=_6e2[j];
if(_6e6.getLocalName&&(_6e6.getLocalName()==xap.xml.xmodify.UpdateDirective.DIRECTIVE_NAMES[xap.xml.xmodify.UpdateDirective.DIRECTIVE_STYLE])){
var name=_6e6.getAttribute("name");
var _6e8=_6e6.getAttribute("value");
_6e4.style[name]=_6e8;
}else{
throw new xap.xml.xmodify.XmodifyException(xap.xml.xmodify.XmodifyException.ATTRIBUTE_ARGUMENT_NOT_ATTRIB_DIRECTIVE,_6e6.nodeName);
}
}
}else{
throw new xap.xml.xmodify.XmodifyException(xap.xml.xmodify.XmodifyException.INVALID_NODE_FOR_COMMAND,_6e4.nodeType,"set-attribute");
}
}
};
xap.xml.xmodify.CommandDirective.prototype._createNode=function(_6e9,_6ea){
var _6eb=(_6e9 instanceof xap.xml.dom.Document);
var _6ec=null,resultNodes=[];
if(_6ea.nodeName=="value-of"){
var name=_6ea.getAttribute("name");
var _6ee=this._directiveSet.variables[name];
if(!_6ee){
throw new xap.xml.xmodify.XmodifyException("Unknown variable : "+name);
}
if(_6ee.needClone===true){
_6ec=_6ee;
this._log.debug("Need to clone "+_6ec.length+" nodes from var "+name);
}else{
return _6ee;
}
}else{
_6ec=[_6ea];
}
if(_6ea.nodeName=="clone"){
var _6ef=_6ea.getAttribute("select");
_6ec=xap.xml.xmodify.CommandDirective.selectMatchingNodes(_6e9,_6ef);
}
var n=null;
if(_6eb){
for(n=0;n<_6ec.length;n++){
resultNodes.push(_6ec[n].deepClone());
}
}else{
for(n=0;n<_6ec.length;n++){
if(_6ec[n] instanceof google.XNode||_6ec[n].nodeType!=google.DOM_ELEMENT_NODE){
var _6f1=this.makeHtmlNode(_6ec[n]);
for(var i=0;i<_6f1.length;i++){
resultNodes.push(_6f1[i]);
}
}else{
resultNodes.push(_6ec[n].cloneNode(true));
}
}
}
this._log.debug("Created "+resultNodes.length+" nodes ");
return resultNodes;
};
xap.xml.xmodify.CommandDirective.prototype.getType=function(){
return (this._type);
};
xap.xml.xmodify.CommandDirective.prototype.formatDocument=function(_6f3){
return "<"+_6f3.nodeName+">";
};
xap.xml.xmodify.CommandDirective.prototype.makeHtmlNode=function(_6f4){
if((_6f4.nodeType==google.DOM_TEXT_NODE||_6f4.nodeType==google.DOM_CDATA_SECTION_NODE)){
if(_6f4.nodeValue){
return this.convertStringToHTML(_6f4.nodeValue);
}
return document.createTextNode();
}else{
if(_6f4 instanceof google.XNode){
return this.convertStringToHTML(_6f4.toXmlWithoutAutoAssignedIds(true));
}else{
targetNode=_6f4.cloneNode(true);
}
}
return targetNode;
};
xap.xml.xmodify.CommandDirective.prototype.convertStringToHTML=function(_6f5){
var s=_6f5.replace(/^\s+|\s+$/g,"");
var div=document.createElement("div");
var tb=[];
var wrap=!s.indexOf("<opt")&&[1,"<select>","</select>"]||(!s.indexOf("<thead")||!s.indexOf("<tbody")||!s.indexOf("<tfoot"))&&[1,"<table>","</table>"]||!s.indexOf("<tr")&&[2,"<table><tbody>","</tbody></table>"]||(!s.indexOf("<td")||!s.indexOf("<th"))&&[3,"<table><tbody><tr>","</tr></tbody></table>"]||[0,"",""];
div.innerHTML=wrap[1]+s+wrap[2];
while(wrap[0]--){
div=div.firstChild;
}
if(dojo.render.html.ie){
if(!s.indexOf("<table")&&s.indexOf("<tbody")<0){
tb=div.firstChild&&div.firstChild.childNodes;
}else{
if(wrap[1]=="<table>"&&s.indexOf("<tbody")<0){
tb=div.childNodes;
}
}
for(var n=tb.length-1;n>=0;--n){
if(tb[n].nodeName.toUpperCase()=="TBODY"&&!tb[n].childNodes.length){
tb[n].parentNode.removeChild(tb[n]);
}
}
}
arg=[];
for(var i=0,l=div.childNodes.length;i<l;i++){
arg.push(div.childNodes[i]);
}
return arg;
};
Xap.provide("xap.xml.xmodify.DirectiveSet");
Xap.require("xap.xml.xmodify.CommandDirective");
xap.xml.xmodify.DirectiveSet=function(_6fc,_6fd){
this._directives=this._createDirectives(_6fc.childNodes,_6fd);
};
xap.xml.xmodify.DirectiveSet.prototype.execute=function(_6fe,_6ff){
for(var i=0;i<this._directives.length;i++){
this._directives[i].execute(_6fe,_6ff);
}
};
xap.xml.xmodify.DirectiveSet.prototype._createDirectives=function(_701,_702){
var _703=[];
for(var i=0;i<_701.length;i++){
var _705=new xap.xml.xmodify.CommandDirective(_701[i],_702,this);
_703.push(_705);
}
return (_703);
};
Xap.provide("xap.xml.xmodify.Xmodify");
Xap.require("xap.xml.xmodify.DirectiveSet");
xap.xml.xmodify.Xmodify=function(_706,_707){
this._modificationsElement=_706;
this._session=_707;
this._directiveSet=new xap.xml.xmodify.DirectiveSet(_706,_707);
};
xap.xml.xmodify.Xmodify.prototype.execute=function(){
var _708=this._modificationsElement.getAttribute("document");
var _709=null;
if(_708===null||_708=="ui"){
_709=this._session.getDocumentContainer().getUiDocument();
}else{
if(_708=="html"){
_709=document;
}
}
this._directiveSet.execute(_709,this._modificationsElement.baseUrl);
};
Xap.provide("xap.xml.xmodify.XmodifyNamespaceHandler");
Xap.require("xap.xml.xmodify.Xmodify");
xap.xml.xmodify.XmodifyNamespaceHandler=function(){
};
xap.xml.xmodify.XmodifyNamespaceHandler.MODIFICATIONS_TAG="modifications";
xap.xml.xmodify.XmodifyNamespaceHandler.prototype.pluginLoaded=function(_70a){
_70a.getNamespaceHandlerManager().addHandler("http://openxal.org/core/xmodify",this);
this._session=_70a;
};
xap.xml.xmodify.XmodifyNamespaceHandler.prototype.receiveDispatch=function(_70b){
var _70c=new xap.xml.xmodify.Xmodify(_70b,this._session);
_70c.execute();
};
Xap.provide("xap.macro.Macro");
Xap.require("xap.xml.ParserFactory");
Xap.require("xap.util.MessageFormat");
xap.macro.Macro=function(_70d,_70e){
this._macroText=_70d;
this._session=_70e;
};
xap.macro.Macro.prototype.execute=function(){
var _70f=this._macroText;
if(arguments&&arguments.length>0){
var args=new Array(arguments.length);
for(var i=0;i<arguments.length;i++){
args[i]=arguments[i];
}
_70f=xap.util.MessageFormat.format(this._macroText,args);
}
var _712=xap.xml.ParserFactory.getParser();
this._session.processDocument(_712.parse(_70f));
};
Xap.provide("xap.macro.MacroNamespaceHandler");
Xap.require("xap.xml.dom.XapElement");
Xap.require("xap.xml.InvalidXmlException");
Xap.require("xap.macro.Macro");
Xap.require("xap.log.Logger");
xap.macro.MacroNamespaceHandler=function(){
};
xap.macro.MacroNamespaceHandler.s_log=xap.log.Logger.getLogger("xap.macro.MacroNamespaceHandler");
xap.macro.MacroNamespaceHandler.prototype.pluginLoaded=function(_713){
_713.getNamespaceHandlerManager().addHandler("http://openxal.org/core/macro",this);
this._session=_713;
};
xap.macro.MacroNamespaceHandler.prototype.receiveDispatch=function(_714){
var _715=this._session;
var name=_714.getAttribute("name");
if(name==null||name==""){
name=_714.getAttribute("id");
if(name==null||name==""||xap.xml.dom.XapElement.isGeneratedId(name)){
_715.handleException(new xap.xml.InvalidXmlException(xap.xml.InvalidXmlException.MISSING_ATTRIBUTE_MSGID,new Array("name",_714.toXml(true))));
}
}
if(xap.macro.MacroNamespaceHandler.s_log.isDebug()){
xap.macro.MacroNamespaceHandler.s_log.debug("Create macro name: ["+name+"] from element: ["+_714.toXml()+"]");
}
var _717=new xap.macro.Macro("<xap>"+_714.childNodes[0].toXmlWithoutAutoAssignedIds()+"</xap>",_715);
var _718=_715.getMacroContainer();
if(_718.get(name)!=null){
xap.macro.MacroNamespaceHandler.s_log.info("Replacing an existing macro registered"+" with name:"+name+". Element:"+_714.toXml());
}
_718.put(name,_717);
};

