我正在尝试将两个使用 XML 单元的 xml 结构与 RecursiveElementNameAndTextQualifier 进行比较。
我的程序和 XML 如下。
String control = "<root> "+
"<ent> "+
"<value> "+
" <int>1</int> "+
"</value> "+
"<value> "+
" <int>2</int>"+
"</value> "+
"</ent> "+
" <ent> "+
"<value> "+
" <int>3</int>"+
" </value> "+
" <value> "+
" <int>4</int> "+
" </value> "+
" </ent> "+
"</root>";
String test = "<root> "+
"<ent> "+
"<value> "+
" <int>3</int> "+
"</value> "+
"<value> "+
" <int>4</int>"+
"</value> "+
"</ent> "+
" <ent> "+
"<value> "+
" <int>1</int>"+
" </value> "+
" <value> "+
" <int>2</int> "+
" </value> "+
" </ent> "+
"</root>";
Diff d = new Diff(control,test);
d.overrideElementQualifier(new RecursiveElementNameAndTextQualifier());
System.out.println(d.similar());
我总是得到错误的价值。我需要设置哪些额外的值来比较这两个 xml 结构。