On Wed, 5 Oct 2022 17:28:08 GMT, Bill Huang <bhu...@openjdk.org> wrote:
>> Added test cases for xpath Axis: >> 1. descendant >> 2. descendant-or-self >> 3. following >> 4. following-sibling > > test/jaxp/javax/xml/jaxp/unittest/xpath/XPathExpDescendantTest.java line 65: > >> 63: >> {"/Customers/Customer[@id='x1']/descendant-or-self::Address", >> "/Customers/Customer[@id = 'x1']/Address"}, >> 64: {"/Customers/Customer[@id='x1']/descendant-or-self::*", >> "/Customers/Customer[@id='x1'] | /Customers/Customer[@id = 'x1']//*"}, >> 65: >> {"/Customers/foo:Customer/foo:Address/descendant-or-self::*", >> "/Customers/foo:Customer/foo:Address | >> /Customers/foo:Customer/foo:Address//*"} > > In the spec, there is a special note saying, "the location path //para[1] > does not mean the same as the location path /descendant::para[1]". Based on > this, it would be good to add a position test case for descendant. e.g. > `/Customers/descendant::Street[2]` > `/Customers/descendant::Street[position()=2]` > `//Street[2]` > `(//Street)[2]` A more cosmetic suggestion besides Bill's technical comments, these lines are a bit too long. We still like the good old 80-character rule (slightly longer is ok), easier for people who use the Sdiffs. ------------- PR: https://git.openjdk.org/jdk/pull/10557