/**
 * @namespace com.thesis.ajax.DataSet
 * @author 钟军锐 August.R@263.net
 * imports com.thesis.ajax.XMLDocument
 */

/** @id DataSet */
function DataSet(sDataType){
	this.sDataType = (typeof sDataType == "undefined")? "text" : sDataType ;
	this.sText = undefined;
	this.iCode = undefined;
	this.XMLDocument = undefined;
	if(typeof DataSet._initialized == "undefined"){
		/** @id clear */
		DataSet.prototype.clear = function(){
			delete this.sText;
			delete this.iCode;
			delete this.XMLDocument;
		};
		/** @id xPath */
		DataSet.prototype.xPath = function(sPath){
			if(sPath && this.XMLDocument){
				try {
					return this.XMLDocument.documentElement.selectNodes(sPath);
				}
				catch (e) {
					//ignore
				}
			}
			return null;
		};
		/** @id singleXPath */
		DataSet.prototype.singleXPath = function(sPath){
			if(sPath && this.XMLDocument){
				return this.XMLDocument.documentElement.selectSingleNode(sPath);
			}
			else{
				return null;
			}
		};
	}
}

