我有以下xml。XSD - 验证属性值是否为
<a>
<thing tag="song1">
<name>john doe</name>
<email>[email protected]</email>
</thing>
<owner thing="https://stackoverflow.com/a/thing[@tag='song1']">
...
</owner>
</a>
我想在XSD断言,当“东西”与标签“松1”存在,“所有者”必须事=“/ A /事情[@标记=”松1' ]。
我的逻辑尝试在XSD是
<sch:assert
test="(count(a:owner[@thing=a:thing[@tag='song1']]) > 0) = count(a:thing[@tag='song1']) > 0))">Error</sch:assert>
</sch:rule>
氧气验证此XSD给出错误。请帮忙。谢谢。