This is an example XPath generated in Optimization Detective:
/*[0][self::HTML]/*[1][self::BODY]
This is actually invalid because it is zero-based when XPath is one-based. It should rather be:
/*[1][self::HTML]/*[2][self::BODY]
In the end it doesn't impact the behavior in any way since it is exclusively using the XPath as a unique key to identify an element. It isn't actually using the XPath for any querying (although it could if the HTML API supported that). But I chose XPath since it is a standard way to identify the path to an element in a document. And this should be fixed to be valid XPath, which can have some debugging value since Chrome DevTools for example supports XPath in the elements panel.
This is an example XPath generated in Optimization Detective:
This is actually invalid because it is zero-based when XPath is one-based. It should rather be:
In the end it doesn't impact the behavior in any way since it is exclusively using the XPath as a unique key to identify an element. It isn't actually using the XPath for any querying (although it could if the HTML API supported that). But I chose XPath since it is a standard way to identify the path to an element in a document. And this should be fixed to be valid XPath, which can have some debugging value since Chrome DevTools for example supports XPath in the elements panel.