I got the same error, and here's a little more info(see bottom for solution):
Line 385:
document._XPathMsxmlDocumentHelper.getDom() This name may not contain the '#' character:-->#<--comment Error
Here's my code:
var nodes = document.evaluate("descendant::*[self::input or self::textarea or self::select]/@name", newNode, null, XPathResult.UNORDERED_NODE_ITERATOR_TYPE, null);
var item;
while(item = nodes.iterateNext()){
}
I know it's been forever since you posted, but for the record... I found this method on the old website, and it worked for me:
var nodes = document.evaluate("descendant::*[self::input or self::textarea or self::select]/@name", newNode, null, XPathResult.UNORDERED_NODE_SNAPSHOT_TYPE, null);
var item;
for (var i=0; i<nodes.snapshotLength; i++){
item = nodes.snapshotItem(i);
}
--Evan
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
When using this library, when attempting to evaluate the expression "//a" I get the following error message from IE:
"This name may not contain the '#' character:
-->#<--comment"
Does anybody know where this error message comes from? Is it a bug in IE or what?
I got the same error, and here's a little more info(see bottom for solution):
Line 385:
document._XPathMsxmlDocumentHelper.getDom() This name may not contain the '#' character:-->#<--comment Error
if (result._isNodeSet)
{
result._domResult = document._XPathMsxmlDocumentHelper.getDom().selectNodes(expression);
}
else
{
result._domResult = true;
result._textResult = document._XPathMsxmlDocumentHelper.getTextResult(expression);
}
Here's my code:
var nodes = document.evaluate("descendant::*[self::input or self::textarea or self::select]/@name", newNode, null, XPathResult.UNORDERED_NODE_ITERATOR_TYPE, null);
var item;
while(item = nodes.iterateNext()){
}
I know it's been forever since you posted, but for the record... I found this method on the old website, and it worked for me:
var nodes = document.evaluate("descendant::*[self::input or self::textarea or self::select]/@name", newNode, null, XPathResult.UNORDERED_NODE_SNAPSHOT_TYPE, null);
var item;
for (var i=0; i<nodes.snapshotLength; i++){
item = nodes.snapshotItem(i);
}
--Evan
These will work but are not exhustively tested.
In the load node function of _XPathMsxmlDocumentHelper
either strip comments out
if( node.nodeType == 8 ){
//do nothing
}else ...
or rewrite them
...
var domNode;
if(node.nodeType == 8){
domNode = dom.createComment(node.nodeValue);
domParentNode.appendChild(domNode);
}else{
domNode = dom.createElement(node.nodeName.toLowerCase());
domParentNode.appendChild(domNode);
loadAttributes(dom, domNode, node);
}
var length = node.childNodes.length;
...