openrewrite/rewrite

Xpath 'nodes from anywhere' + attribute selection does not work

Closed this issue · 2 comments

What version of OpenRewrite are you using?

main branch

How are you running OpenRewrite?

The following test fails on the last assertThat when added to XPathMatcherTest

    @Test
    void noMatterWhereAttributeSelection() {
        assertThat(match("/dependencies/dependency/artifactId[@scope='compile']", xmlDoc)).isTrue();
        assertThat(match("//artifactId[@scope='compile']", xmlDoc)).isTrue();
        assertThat(match("//dependency/artifactId[@scope='compile']", xmlDoc)).isTrue();
    }

Are you interested in contributing a fix to OpenRewrite?

I always want to, but time is short:( #4269 is currently more concerning for us:)

  • Now that #4532 was merged, these tests succeed 🙂

Thanks again @DidierLoiseau !