function tokenizeXML(xmlString) {
		var tokens = [];
		var tmpToken = '';
		var char = '';
		var escapedXMLString = decodeXML(xmlString);
		
		for (var c = 0; c < escapedXMLString.length; c++) {
			char = escapedXMLString.charAt(c);

			// Skip any leading whitespace, tab, and newline characters between nodes
			while (tmpToken === '' && (' ' === char || '\n' === char || '\t' === char)) {
				char = escapedXMLString.charAt(++c);
			}

			// If finished reading a value, push it to the token list
			if ('' !== tmpToken && '<' === char)
			{
				tokens.push(tmpToken);
				tmpToken = '';
			}

			// If not at the end of the tag, keep going
			if ('>' !== char) {
				tmpToken += char;
			}
			
			// End of tag found, push it to the token list
			if ('>' === char) {
				tmpToken += char;
				tokens.push(tmpToken);
				tmpToken = '';
			}

			// Process comment
			if (tmpToken === '<!--') {
				while (true) {
					char = escapedXMLString.charAt(++c);
					
					// Check for the end of the comment
					if ('-' === char) {
						var next = escapedXMLString.charAt(c+1);
						var nextnext = escapedXMLString.charAt(c+2);

						if (next === '-' && nextnext === '>') {
							c += 2; // Advance c past the end of the comment (2 for the final 2 characters in '-->')
							break;
						}
					}
				}
				tmpToken = '';
			}
		}

		return tokens;
	}
/*
	*	Splits an xml string into individual tokens including tags and values.
	*	@param {String} xmlString
	*	@return {Array} - Returns an array of all the tags and values of the xml string
	*/
Splits an xml string into individual tokens including tags and values.
@param {String} xmlString
@return {Array} - Returns an array of all the tags and values of the xml string
Splits an xml string into individual tokens including tags and values . @param { String } xmlString @return { Array } - Returns an array of all the tags and values of the xml string
function tokenizeXML(xmlString) {
		var tokens = [];
		var tmpToken = '';
		var char = '';
		var escapedXMLString = decodeXML(xmlString);
		for (var c = 0; c < escapedXMLString.length; c++) {
			char = escapedXMLString.charAt(c);
			while (tmpToken === '' && (' ' === char || '\n' === char || '\t' === char)) {
				char = escapedXMLString.charAt(++c);
			}
			if ('' !== tmpToken && '<' === char)
			{
				tokens.push(tmpToken);
				tmpToken = '';
			}
			if ('>' !== char) {
				tmpToken += char;
			}
			if ('>' === char) {
				tmpToken += char;
				tokens.push(tmpToken);
				tmpToken = '';
			}
			if (tmpToken === '<!--') {
				while (true) {
					char = escapedXMLString.charAt(++c);
					if ('-' === char) {
						var next = escapedXMLString.charAt(c+1);
						var nextnext = escapedXMLString.charAt(c+2);
						if (next === '-' && nextnext === '>') {
							c += 2; 
							break;
						}
					}
				}
				tmpToken = '';
			}
		}
		return tokens;
	}
function tokenizeXML ( xmlString ) { var tokens = [ ] ; var tmpToken = '' ; var char = '' ; var escapedXMLString = decodeXML ( xmlString ) ; for ( var c = 0 ; c < escapedXMLString . length ; c ++ ) { char = escapedXMLString . charAt ( c ) ; while ( tmpToken === '' && ( ' ' === char || '\n' === char || '\t' === char ) ) { char = escapedXMLString . charAt ( ++ c ) ; } if ( '' !== tmpToken && '<' === char ) { tokens . push ( tmpToken ) ; tmpToken = '' ; } if ( '>' !== char ) { tmpToken += char ; } if ( '>' === char ) { tmpToken += char ; tokens . push ( tmpToken ) ; tmpToken = '' ; } if ( tmpToken === '<!--' ) { while ( true ) { char = escapedXMLString . charAt ( ++ c ) ; if ( '-' === char ) { var next = escapedXMLString . charAt ( c + 1 ) ; var nextnext = escapedXMLString . charAt ( c + 2 ) ; if ( next === '-' && nextnext === '>' ) { c += 2 ; break ; } } } tmpToken = '' ; } } return tokens ; }
Splits an xml string into individual tokens including tags and values.
Splits an xml string into individual tokens including tags and values .
// Skip any leading whitespace, tab, and newline characters between nodes // If finished reading a value, push it to the token list // If not at the end of the tag, keep going // End of tag found, push it to the token list // Process comment // Check for the end of the comment // Advance c past the end of the comment (2 for the final 2 characters in '-->')