Reputation: 93
I am trying to write a schematron rule as such: The owner attribute exists only if the name attribute exists. For example:
<business name="n1" owner="o1" />
the owner attribute can only exist if the name attribute exists. Thanks!
Upvotes: 2
Views: 766
Reputation: 111491
You can assert that either both @owner
and @name
exists, or @owner
does not:
<rule context="business">
<assert test="(@owner and @name) or not(@owner)">
The owner attribute requires the name attribute.
</assert>
</rule>
Upvotes: 2