我有一个 xml,其属性在值中包含引号。有没有可能用 xsd 验证 xml 的方法?
XML:
<root>
<item size="11"x17""/>
</root>
错误:
Error displayed: Assertion failure message: fatal: line=5 col=268 Element type "item" must be followed by either attribute specifications, ">" or "/>".
据我了解,您正在使用 jmeter 的XML Schema Assertion。
您也可以尝试手动针对 xsd 验证您的 xml:只需使用相应的 java 代码,例如BeanShell Assertion或BeanShell PostProcessor;这是一个非常好的工作解决方案:https ://stackoverflow.com/a/16054/993246 (您也可以使用任何其他您想要的)。