【发布时间】:2015-10-25 15:39:38
【问题描述】:
假设我有一个 XML 文档定义:
<people>
<person>
<city>London</city>
</person>
<person>
<city>Paris</city>
</person>
</people>
我想要一个 schematron 来检查每个人是否住在伦敦。
我试过了:
<sch:rule context="people">
<sch:assert test="person/city = 'London'">Everybody must live in London!</sch:assert>
</sch:rule>
但是,只要存在一个住在伦敦的人,这就会返回 true。有没有办法告诉 schematron 对匹配 XPathcondition 人/城市的每个元素应用测试?
【问题讨论】:
标签: xml xpath xquery schematron