最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

java - Dectect deleted element using XMLUnit - Stack Overflow

programmeradmin1浏览0评论

I´m comparing 2 xmls and trying to detect element deletion.

Old:

<a>
    <b>
        Text 1
    </b>
    <b>
        Text 2
    </b>
    <b>
        Text 3
    </b>
</a>

new:

<a>
    <b>
        Text 2
    </b>
    <b>
        Text 3
    </b>
</a>

The result that I was expecting is:

Deleted element:/a[1]/b[1]

But XmlUnit returns

It compares every node and mark the last one as deleted.

I have already tried ElementSelector.byNameAndText. For this example it works fine but, all other text changes that I may have in the XMl it does not return Text Changed. It returns node deleted and added.

Any ideas how to make it works and if it is possible? Thanks!

发布评论

评论列表(0)

  1. 暂无评论