-
Notifications
You must be signed in to change notification settings - Fork 9
Description
The ISO 32000-2 Specification reads for "A": "shall not be present if a Dest entry is present".
fn:IsPresent(key) shall be interpreted as: "asserts that the current row must be present if key is present".
The current logic should, to my understanding, be evaluated as:
| Dest | A | IsPresent (logical implication: Dest => A) | Not |
|---|---|---|---|
| 0 | 0 | True | False |
| 0 | 1 | True | False |
| 1 | 0 | False | True |
| 1 | 1 | True | False |
While the condition should be interpreted as:
| Dest | A | Both Present (logical and: Dest and A) | Not |
|---|---|---|---|
| 0 | 0 | False | True |
| 0 | 1 | False | True |
| 1 | 0 | False | True |
| 1 | 1 | True | False |
In my opinion the functionality of "IsPresent" should be reworked so that it only takes one Key/Path as argument and resolves to True if that Key is present. This would be a breaking change but, in the end, a more intuitive implementation.
Additionally there could be a "Implication(A, B)" function where A and B both resolve to a boolean and the Implication function implements the first Table of this issue.
For cases where the first logic is needed a function would look like this:
fn:Implication(fn:IsPresent(Other), fn:IsPresent(CurrentRow))
And where the second logic is needed a function would look like this:
fn:Eval(fn:IsPresent(A) && fn:IsPresent(B))
I was looking at the veraPDF project and how they interpret "fn:IsPresent" and they basically change the implementation if the function is wrapped in a "fn:Not"