

function TXMLRs() {}

TXMLRs.prototype = 
{
	
	xmldom_ : null,
	nodes_ : null,
	cursor_ : 0,
	
	Open : function (xmldom, rownode) {
		this.cursor_ = 0;
		this.xmldom_ = xmldom;
		this.nodes_ = this.xmldom_.getElementsByTagName(rownode) /* ex) rownode = "Table" */

		return this.nodes_ == null ? false : true;
	},

	RecordCount : function () {
		return this.nodes_.length;
	},

	MoveFirst : function () {
		this.cursor_ = 0;
	},

	MoveLast : function () {
		this.cursor_ = this.RecordCount();
	}, 

	MoveNext : function () { 
		++this.cursor_;
	},

	MovePrev : function () {
		if (--this.cursor_ < 0) {
			this.cursor_ = 0;
		}
	},

	Move : function (c) {
		this.cursor_ = c;
	},

	Row : function () {
		return this.cursor_;
	},

	EOF : function () {
		return this.cursor_ >= this.RecordCount();
	},

	BOF : function () {
		return this.cursor_ == 0
	},

	Item : function (nodename) {
		var value = " ";
		var nodeItems = this.nodes_[this.cursor_].getElementsByTagName(nodename)

		if (nodeItems.length > 0)
		{	
			// text node °ªÀÌ ºñ¾î ÀÖÀ»¶§ ¹ö±× ¼öÁ¤ 
			if (nodeItems[0].firstChild != null)
			{
				value = nodeItems[0].firstChild.nodeValue;	
			}
		}
		return value;
	}
}
