XPath queries in IE use zero-based indexes but the W3C spec is one-based. How should I handle the difference?
The Problem I am converting a relatively large piece of Javascript that currently only works on Internet Explorer in order to make it work on the other browsers as well. Since the code uses XPath extensively we made a little compatibility function to make things easier function selectNodes(xmlDoc, xpath){ if('selectNodes' in xmlDoc){ //use IE logic }else{ //use W3C's document.evaluate } } This is mostly working fine but we just came across the limitation that positions in IE are zero-based but in the W3C model used by the other browsers they are one-based . This means that to get the first