Re: [xml-dev] Testing XML don't use xUnit

From
Ihe Onwuka <>
To
George Cristian Bina <>
Date
2013-04-12T12:48:30Z
ID
<CALfs7+zB1O7yEedUrtwuU=>
Thread
Re: [xml-dev] Testing XML don't use xUnit
On Thu, Apr 11, 2013 at 4:04 AM, George Cristian Bina
<> wrote:
> Hi Ihe,
>
> People asked for a Schematron example that you think cannot be written as an
> XPath only test then they wanted to show you the equivalent XPath for that.
>
> Basically, in Schematron you have
>
> rule/@context = XPath expression
> assert/@test = XPath expression
>
> these can be written in XPath 2.0 as
>
> //(context)/test
>
> where context is the rule/@context expression and test is the assert/@test
> expression.
>
> So, the challenge will be to come up with a Schematron example for which
> someone cannot write an XPath equivalent. If you cannot provide such an
> example then you should accept that they are equivalent, at least for your
> use cases.
>

Would it be fair for me to characterise that as follows.

For every instance in which I can harness static dispatch semantics to
fire the correct  rule (or match the correct  template) you can define
a variable with the corresponding XPath (it cannot just be //context
because context may feature in multiple content models)  that will
lead to the correct assertion, being fired. Therefore a style of
programming that does not harness static dispatch (I'll call that pull
 procedural) is equivalent to a style of programming that does (push).