在比较两个XMl文档时,有没有办法让XML Unit忽略大小写?标签及其值......对我来说都是一样的吗?
XMLUnit给了我以下区别:Expected attribute value 'FALSE' but was 'false'
我尝试在两个输入字符串上使用.toUpperCase()
,但后来我收到了这个错误:
[Fatal Error] :1:6: The processing instruction target matching "[xX][mM][lL]" is not allowed.
org.xml.sax.SAXParseException: The processing instruction target matching "[xX][mM][lL]" is not allowed.
at org.apache.xerces.parsers.DOMParser.parse(Unknown Source)
at org.apache.xerces.jaxp.DocumentBuilderImpl.parse(Unknown Source)
at org.custommonkey.xmlunit.XMLUnit.buildDocument(XMLUnit.java:383)
at org.custommonkey.xmlunit.XMLUnit.buildDocument(XMLUnit.java:370)
at org.custommonkey.xmlunit.Diff.<init>(Diff.java:101)
at org.custommonkey.xmlunit.Diff.<init>(Diff.java:93)
有任何不同方法的想法吗?还是一种摆脱错误的方法?
答案 0 :(得分:0)
因此,如果我使用.toLowerCase()
它可以正常工作......与Doctype大写相关会导致问题或类似问题...