This project has moved and is read-only. For the latest updates, please go here.
1
Vote

Differing results returned using name and local-name()

description

I am experiencing differing results using Html Agility Pack when trying to match an attribute starting with a given value. Using the sample HTML below:
<!DOCTYPE html>
<html>
<head>
<title>Title</title>
</head>
<body>
<p>Loren ipsum</p>
<a href="http://www.myurl.com" onclick="myFunction()"></a>
</body>
</html>
Using DocumentNode.SelectNodes() with the following query returns no results:
//*/@*[starts-with(name(), 'on')]
But using DocumentNode.SelectNodes() with the following query does return results:
//*/@*[starts-with(local-name(), 'on')]
I believe these should return the same results.

comments