rem: if ((i = classNames.length)){ while (i--) temp += '[contains(concat(" ", @class, " "), " ' + classNames[i] + ' ")]'; } if ((i = attributes.length)){ while (i--){ var attribute = attributes[i].match(Selectors.aRegExp); if (!attribute) continue; if (attribute[2] && attribute[3]){ switch (attribute[2]){ case '=': temp += '[@' + attribute[1] + '="' + attribute[3] + '"]'; break; case '*=': temp += '[contains(@' + attribute[1] + ', "' + attribute[3] + '")]'; break; case '^=': temp += '[starts-with(@' + attribute[1] + ', "' + attribute[3] + '")]'; break; case '$=': temp += '[substring(@' + attribute[1] + ', string-length(@' + attribute[1] + ') - ' + attribute[3].length + ' + 1) = "' + attribute[3] + '"]'; break; case '!=': temp += '[@' + attribute[1] + '!="' + attribute[3] + '"]'; break; case '~=': temp += '[contains(concat(" ", @' + attribute[1] + ', " "), " ' + attribute[3] + ' ")]'; case '|=': temp += '[contains(concat("-", @' + attribute[1] + ', "-"), "-' + attribute[3] + '-")]'; } } else { temp += '[@' + attribute[1] + ']'; 
add: for (i = classNames.length; i--; i) temp += '[contains(concat(" ", @class, " "), " ' + classNames[i] + ' ")]'; for (i = attributes.length; i--; i){ var attribute = attributes[i]; if (attribute[2] && attribute[3]){ switch (attribute[2]){ case '=': temp += '[@' + attribute[1] + '="' + attribute[3] + '"]'; break; case '*=': temp += '[contains(@' + attribute[1] + ', "' + attribute[3] + '")]'; break; case '^=': temp += '[starts-with(@' + attribute[1] + ', "' + attribute[3] + '")]'; break; case '$=': temp += '[substring(@' + attribute[1] + ', string-length(@' + attribute[1] + ') - ' + attribute[3].length + ' + 1) = "' + attribute[3] + '"]'; break; case '!=': temp += '[@' + attribute[1] + '!="' + attribute[3] + '"]'; break; case '~=': temp += '[contains(concat(" ", @' + attribute[1] + ', " "), " ' + attribute[3] + ' ")]'; case '|=': temp += '[contains(concat("-", @' + attribute[1] + ', "-"), "-' + attribute[3] + '-")]'; 
context: 	getParam: function(items, separator, context, tag, id, classNames, attributes, pseudos){		var temp = context.namespaceURI ? 'xhtml:' : '';		switch (separator){			case '~': case '+': temp += '/following-sibling::'; break;			case '>': temp += '/'; break;			case ' ': temp += '//';		}		temp += tag;		if (separator == '+') temp += '[1]';		var i;		if ((i = pseudos.length)){			while (i--){				var pseudo = Selectors.Pseudo.$parse(pseudos[i]);				var xparser = Selectors.Pseudo[pseudo.name];				if (xparser && xparser.xpath) temp += xparser.xpath(pseudo.argument);				else temp += ($chk(pseudo.argument)) ? '[@' + pseudo.name + '="' + pseudo.argument + '"]' : '[@' + pseudo.name + ']';			}		}		if (id) temp += '[@id="' + id + '"]';		if ((i = classNames.length)){			while (i--) temp += '[contains(concat(" ", @class, " "), " ' + classNames[i] + ' ")]';		}		if ((i = attributes.length)){			while (i--){				var attribute = attributes[i].match(Selectors.aRegExp);				if (!attribute) continue;				if (attribute[2] && attribute[3]){					switch (attribute[2]){						case '=': temp += '[@' + attribute[1] + '="' + attribute[3] + '"]'; break;						case '*=': temp += '[contains(@' + attribute[1] + ', "' + attribute[3] + '")]'; break;						case '^=': temp += '[starts-with(@' + attribute[1] + ', "' + attribute[3] + '")]'; break;						case '$=': temp += '[substring(@' + attribute[1] + ', string-length(@' + attribute[1] + ') - ' + attribute[3].length + ' + 1) = "' + attribute[3] + '"]'; break;						case '!=': temp += '[@' + attribute[1] + '!="' + attribute[3] + '"]'; break;						case '~=': temp += '[contains(concat(" ", @' + attribute[1] + ', " "), " ' + attribute[3] + ' ")]';						case '|=': temp += '[contains(concat("-", @' + attribute[1] + ', "-"), "-' + attribute[3] + '-")]';					}				} else {					temp += '[@' + attribute[1] + ']';				}			}		}		items.push(temp);		return items;	},
meta: 6317	/local1/tlutelli/issta_data/temp/all_js/javascript/2007_temp/2007/6317/fed5a45bea442e0b14d2fddf2fdc57d9e9f5df0a/Selectors.js/buggy/Selectors/Selectors.js