在比较两个 XML 文档时,有没有办法让 XML 单元忽略大小写?标签和它们的值......对我来说是一样的吗?
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)
有什么不同的方法可以做到这一点吗?还是摆脱错误的方法?