有没有办法让XML Unit在比较两个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)
有什么不同的方法吗?或者是一种摆脱错误的方法?
发布于 2012-03-30 01:05:06
因此,如果我使用.toLowerCase(),它可以工作...与Doctype大写有关的事情会导致问题或诸如此类的事情...
https://stackoverflow.com/questions/9929908
复制相似问题