rem: if (attributeValue && attribute.specified) 
add:  /** SELENIUM:PATCH for loadAttributes() - see SEL-176 */ if (attributeValue && (attribute.specified || attribute.nodeName == 'value')) /** END SELENIUM:PATCH */ 
context: 	function _XPathMsxmlDocumentHelper()	{		this.getDom = function()		{			activateDom(this);			return this.dom;		}				this.getXml = function()		{			activateDom(this);			return this.dom.xml;		}				this.getTextResult = function(expression)		{			expression = expression.replace(/</g, "&lt;").replace(/>/g, "&gt;").replace(/"/g, "\"");			var xslText = "<xsl:stylesheet version=\"1.0\" xmlns:xsl=\"http://www.w3.org/1999/XSL/Transform\">" +				"<xsl:output method=\"text\"/><xsl:template match=\"*\"><xsl:value-of select=\"" + expression + "\"/>" +				"</xsl:template></xsl:stylesheet>";			var xsl = new ActiveXObject("Msxml2.DOMDocument");			xsl.loadXML(xslText);			try			{				var result = this.getDom().transformNode(xsl);			}			catch(error)			{				alert("Error: " + error.description);			}			return result;		}				this.reset = function()		{			this.dom = null;		}				function onPropertyChangeEventHandler()		{			document._propertyChangeDetected = true;		}				this.documentChangeDetected = function()		{			return (document.ignoreDocumentChanges ? false : this._currentElementCount != document.all.length || document._propertyChangeDetected);		}				function activateDom(helper)		{			if (!helper.dom)			{				var dom = new ActiveXObject("Msxml2.DOMDocument");/** SELENIUM:PATCH TO ALLOW PROVIDE FULL XPATH SUPPORT */				dom.setProperty("SelectionLanguage", "XPath");/** END SELENIUM:PATCH */				dom.async = false;				dom.resolveExternals = false;				loadDocument(dom, helper);				helper.dom = dom;				helper._currentElementCount = document.all.length;				document._propertyChangeDetected = false;			}			else			{				if (helper.documentChangeDetected())				{					var dom = helper.dom;					dom.load("");					loadDocument(dom, helper);					helper._currentElementCount = document.all.length;					document._propertyChangeDetected = false;				}			}		}				function loadDocument(dom, helper)		{			return loadNode(dom, dom, document.body, helper);		}			/** SELENIUM:PATCH for loadNode() - see SEL-68 */		function loadNode(dom, domParentNode, node, helper)		{			// Bad node scenarios			// 1. If the node contains a /, it's broken HTML			// 2. If the node doesn't have a name (typically from broken HTML), the node can't be loaded			// 3. Node types we can't deal with			//			// In all scenarios, we just skip the node. We won't be able to			// query on these nodes, but they're broken anyway.			if (node.nodeName.indexOf("/") > -1			    || node.nodeName == ""			    || node.nodeName == "#document"			    || node.nodeName == "#document-fragment"			    || node.nodeName == "#cdata-section"			    || node.nodeName == "#xml-declaration"			    || node.nodeName == "#whitespace"			    || node.nodeName == "#significat-whitespace"			   )			{				return;			}						// #comment is a <!-- comment -->, which must be created with createComment()			if (node.nodeName == "#comment")			{				try				{					domParentNode.appendChild(dom.createComment(node.nodeValue));				}				catch (ex)				{					// it's just a comment, we don't care				}			}			else if (node.nodeType == 3)			{				domParentNode.appendChild(dom.createTextNode(node.nodeValue));			}			else			{				var domNode = dom.createElement(node.nodeName.toLowerCase());				if (!node.id)				{					node.id = node.uniqueID;				}				domParentNode.appendChild(domNode);				loadAttributes(dom, domNode, node);				var length = node.childNodes.length;				for(var i = 0; i < length; i ++ )				{					loadNode(dom, domNode, node.childNodes[i], helper);				}				node.attachEvent("onpropertychange", onPropertyChangeEventHandler);			}		}/** END SELENIUM:PATCH */		function loadAttributes(dom, domParentNode, node)		{			for (var i = 0; i < node.attributes.length; i ++ )			{				var attribute = node.attributes[i];				var attributeValue = attribute.nodeValue;				if (attributeValue && attribute.specified)				{					var domAttribute = dom.createAttribute(attribute.nodeName);					domAttribute.value = attributeValue;					domParentNode.setAttributeNode(domAttribute);								}			}		}		}
meta: 3428	/local1/tlutelli/issta_data/temp/all_js/javascript/2006_temp/2006/3428/0e5a94dd69f1f4d393236fe9aaa04b10fc67be8f/html-xpath-patched.js/buggy/code/javascript/html-xpath/html-xpath-patched.js