Information on the selected element Information on the selected attribute Information on the selected element level ){ cpt++; i++; } this.elements.splice(index +1 , cpt); i=index+1; if(this.elements.length > i){ for(i=index+1; i < this.elements.length; i++){ // update parentIndex if(this.elements[i].parentIndex > index){ this.elements[i].parentIndex = this.elements[i].parentIndex - cpt; } } } this.elements[index].isOpened= !this.elements[index].isOpened; this.rowCount =this.elements.length; this.treebox.rowCountChanged(index,-cpt); }else{ // it is closed, we add children var list=this.elements[index].element.childNodes; cpt= list.length; var linecount=this.elements[index].eltNumber+1; var eltinfo; for(i=0; i < cpt; i++){ eltinfo= this.widget.getEltInfo(list[i], this.elements[index].level+1, index ); eltinfo.eltNumber=linecount; this.elements.splice( index+1+i,0,eltinfo); linecount+= this.widget._countChildren(list[i]) + 1; } if(this.elements.length > (index+cpt+1)){ for ( i=index+cpt+1; i < this.elements.length; i++){ // update parentIndex if(this.elements[i].parentIndex > index){ this.elements[i].parentIndex = this.elements[i].parentIndex + cpt; } } } this.elements[index].isOpened= !this.elements[index].isOpened; this.rowCount =this.elements.length; this.treebox.rowCountChanged(index,cpt); } //this.showElements(); } }, canDrop : function ( index, orientation ) {return false;}, drop : function ( row , orientation ) {}, cycleCell : function ( row , col ) {}, cycleHeader : function ( col ) {}, showElements : function(){ dbgEcho('dump de elements','important'); var i,j; var blanc=''; var eltinfo; for(i=0; i < this.elements.length; i++){ eltinfo= this.elements[i]; blanc=''; for(j=0; j < eltinfo.level; j++){ blanc += ' '; } dbgEcho( blanc+'['+i+']^'+ eltinfo.parentIndex + ' '+ eltinfo.text + ' lev='+eltinfo.level + ' ' + eltinfo.isContainer + ' ' + eltinfo.isContainerEmpty ); } } } this._view.widget = this; this._authorizedChildList = null; this._authorizedAttributeList = null; this._schema = null; // serializer needs that an node have a ownerDocument. But blank nodes provided // by the schema don't have it. so we have to add it to a foo document before // serializing it. And so, we have to create this foo document. var domparser = Components.classes['@mozilla.org/xmlextras/domparser;1'] .createInstance(Components.interfaces.nsIDOMParser); this._foodoc = domparser.parseFromString ( "", 'text/xml'); this._fooelement = this._foodoc.documentElement; ]]> return this._schema; this._schema = val; 0){ this._view.elements = new Array(); this._view.rowCount=0; } this._view.elements.push(eltinfo); this._view.rowCount=this._view.elements.length; document.getAnonymousElementByAttribute(this, 'anonid', 'xmldoctree').view = this._view; } ]]> "; eltinfo.value = elt.data; eltinfo.property = 'processing'; break; case elt.COMMENT_NODE : eltinfo.value = elt.nodeValue; eltinfo.property='comment'; break; case elt.DOCUMENT_NODE : eltinfo.isContainer = true; eltinfo.isContainerEmpty =! elt.hasChildNodes(); break; case elt.DOCUMENT_TYPE_NODE : eltinfo.property='doctype'; break; case elt.DOCUMENT_FRAGMENT_NODE : eltinfo.isContainer = true; eltinfo.isContainerEmpty = !elt.hasChildNodes(); break; case elt.NOTATION_NODE : eltinfo.property='notation'; break; } return eltinfo; ]]> -1 && this._authorizedChildList){ var info = this._authorizedChildList.queryElementAt ( index , Components.interfaces.diISchemaElementProperties ); document.getAnonymousElementByAttribute(this, 'anonid', 'popup-info-label').value=info.label; document.getAnonymousElementByAttribute(this, 'anonid', 'popup-info-description').value=info.description; document.getAnonymousElementByAttribute(this, 'anonid', 'popup-info-semantic').value=info.semantics; }else{ document.getAnonymousElementByAttribute(this, 'anonid', 'popup-info-label').value=""; document.getAnonymousElementByAttribute(this, 'anonid', 'popup-info-description').value=""; document.getAnonymousElementByAttribute(this, 'anonid', 'popup-info-semantic').value=""; } ]]> -1 && this._authorizedAttributeList){ var info = this._authorizedAttributeList.queryElementAt ( index , Components.interfaces.diISchemaAttributeProperties ); document.getAnonymousElementByAttribute(this, 'anonid', 'popup-info-attr-label').value=info.label; document.getAnonymousElementByAttribute(this, 'anonid', 'popup-info-attr-description').value=info.description; document.getAnonymousElementByAttribute(this, 'anonid', 'popup-info-attr-defaultvalue').value=info.defaultValue; }else{ document.getAnonymousElementByAttribute(this, 'anonid', 'popup-info-attr-label').value=""; document.getAnonymousElementByAttribute(this, 'anonid', 'popup-info-attr-description').value=""; document.getAnonymousElementByAttribute(this, 'anonid', 'popup-info-attr-defaultvalue').value=""; } ]]> this._doc = null; this._textHasChanged = false return this._textHasChanged this._textHasChanged = val; if(this.textHasChanged){ this._updateTree(); } return this._doc; this._doc=val; if(this._doc == null){ document.getAnonymousElementByAttribute(this, 'anonid','source').value=""; }else{ var xmlserial = Components.classes["@mozilla.org/xmlextras/xmlserializer;1"] .createInstance(Components.interfaces.nsIDOMSerializer); var str = xmlserial.serializeToString ( val ); document.getAnonymousElementByAttribute(this, 'anonid','source').value=str; } return document.getAnonymousElementByAttribute(this, 'anonid','source').value; document.getAnonymousElementByAttribute(this, 'anonid','source').value= val; this._updateTree(); Text describing the error The source XML we tried to parse */ gResultsCons.addMessage('Errors appears during the parsing of the xml document !','error'); for(i=0; i < xmlerrors.length; i++){ gResultsCons.addMessage(xmlerrors[i].firstChild.nodeValue,'warning'); gResultsCons.addMessage(xmlerrors[i].childNodes[1].firstChild.nodeValue); } gResultsCons.addMessage('Correct this error please','warning'); xmlDoc = null; } this._doc = xmlDoc; this.textHasChanged=false; return (xmlDoc != null); ]]> return document.getAnonymousElementByAttribute(this, 'anonid','tree').schema; document.getAnonymousElementByAttribute(this, 'anonid','tree').schema = val; if(this.textHasChanged){ this._updateTree(); } return this._doc; this._doc=val; if(this._doc == null){ document.getAnonymousElementByAttribute(this, 'anonid','source').value=""; document.getAnonymousElementByAttribute(this, 'anonid','tree').setDoc(this._doc); }else{ var xmlserial = Components.classes["@mozilla.org/xmlextras/xmlserializer;1"] .createInstance(Components.interfaces.nsIDOMSerializer); var str = xmlserial.serializeToString ( val ); document.getAnonymousElementByAttribute(this, 'anonid','source').value=str; document.getAnonymousElementByAttribute(this, 'anonid','tree').setDoc(this._doc); }