XPath table column 1 selection incorrect output

Confirmed Issue #14591513 • Assigned to travil

Details

Author
David H.
Created
Nov 9, 2017
Privacy
This issue is public.
Found in
  • Microsoft Edge
Standard affected
XML Path Language (XPath)

Reports
Reported by 1 person

Sign in to watch or report this issue.

Steps to reproduce

When trying to get the first column of a table using XPath it instead returns only the first cell. It seems that 1 is not treated as a number.

Demonstration below, but was found through selenium:

https://codebeautify.org/Xpath-Tester (uses the browser’s evaluation)

XML Input

<table>
<tbody>
<tr> <td id="1" /> <td id="2" /> <td id="a" /> </tr>
<tr> <td id="3" /> <td id="4" /> <td id="b" /> </tr>
</tbody>
</table>

XPath Expression

//tr/td[1]

expected result:

<td id="1" />
<td id="3" />

actual result

<td id="1" />

changing the xpath to:

//tr/td[0+1]

results in the correct output

Numbers other than 1 work:
XPath Expression

//tr/td[2]

expected and actual output

<td id="2" />
<td id="4" />

Attachments

0 attachments

    Comments and activity

    • //tr/td[01]
      

      also works

    • Microsoft Edge Team

      Changed Assigned To to “James M.”

      Changed Assigned To to “edgedevtoolstri@microsoft.com”

      Changed Assigned To to “travil”

      Changed Status to “Confirmed”

    You need to sign in to your Microsoft account to add a comment.

    Sign in