Re: calabash p:delete not working

On Sat, Oct 4, 2008 at 10:14 PM, Josh Matthews <joshmatthews@gmail.com>wrote:

>
> (That said, an argument could be made to the contrary: the spec reads "It
> is a dynamic error (err:XD0019) if any option value does not satisfy the
> type required for that option". The required type for the match option on
> p:delete is XSLTMatchPattern (the formal definition of which is, I assume,
> the "Pattern" construct in the XSLT spec), which does not allow an empty
> string. Even so, I'd still argue that the above use case is possible, sane,
> and shouldn't result in an error).
>

A clarification, sorry: "" is not an empty string ("''" is). I'd say the
interpretation of:

  <p:delete match=""/>

is then equivalent to:

  <p:delete />

which provides for an interesting interpretation of the spec with regards to
errors. The specs states "It is a static error (err:XS0038) if any required
attribute is not provided." However, in the aforementioned case that results
in the equivalent of a call to <p:delete /> (with no match attribute
provided), it's just not possible to detect it as a static error (you don't
know there's no //a result until you dynamically evaluate the input). Hence,
there's no defined error to raise!

In my opinion, then, you'd be compliant (and acting for the greater good of
XML flexibility!) to just not delete anything.

Cheers,
Josh Matthews

Received on Sunday, 5 October 2008 02:30:03 UTC