How to test for a non-existent element in Schematron

Viewed 989

Is it just me or is it impossible to look for a non existent element via Schematron. I also don't seem to be able to find any documentation on this as well.

Take the following rule:

    <sch:rule context="/A/B/C[@TYPE='TEST1']" id="identifier-required">
    identifier must be present
        <sch:assert test="not(.)" id="identifier-required">
    identifier-required: identifier must be present
        </sch:assert>
    </sch:rule>

And apply it against the following document:

<A>
   <B>
      <C TYPE="TEST2">TEST</C>
      <C TYPE="TEST3">TEST</C>
   </B>
</A>

In theory this should fail, however I've found it doesn't. Anyone know if this is correct behaviour?

2 Answers
Related