使用jmeter中的xsd验证其属性值在其中具有引号的xml

时间:2013-03-20 12:37:48

标签: xml xsd jmeter

我有一个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 "/>".

1 个答案:

答案 0 :(得分:0)

据我所知,你正在使用jmeter的XML Schema Assertion

您也可以尝试手动验证xml对xsd:只需使用相应的java代码即可。 BeanShell AssertionBeanShell PostProcessor;这是一个非常好的工作解决方案:https://stackoverflow.com/a/16054/993246(你可以使用任何你想要的其他方法)。

相关问题