-
Notifications
You must be signed in to change notification settings - Fork 6
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fields and Widgets, Widgets and Fields. #28
Comments
Incidentally I tried the first suggestion, the splitting of EDIT 20201001 - the one complexity is |
Another followup on this:
|
On reflection this is an aspect of our implementation not the model. |
I'm starting to work on this. |
"Required if field contains variable text" is not yet captured via predicates. See also Issue #28
This issue still pops up regularly in the tests, as Field and AnnotWidget have different permitted entries. One of the solutions would be to have a separate type for the merged Field+Widget dictionary. This would lead in fact to the following new types:
This looks a bit weird, but I don't immediately see any other nicer solutions. |
Just as an update, the latest version of veraPDF-based Arlington app implements the above suggestion when doing the conversion of the .tsv files to the veraPDF Arlington profile. Seems to work as expected https://software.verapdf.org/develop/arlington/1.25/verapdf-arlington-1.25.236-installer.zip |
It was inevitable this was going to come up at some point.
First, I'm assuming a processing model which means a node in the PDF can be of more than one type. Traverse to a combined field+widget from
Fields
? It's validated as Field. Traverse from aPage
? It's also validated as a Widget. Everything below assumes that model, if that's not how you do it I guess you can ignore the whole thing.Currently there are 3 types,
Field
(an untyped field with noFT
),FieldNNN
(a typed field withFT
) andAnnotWidget
. And there is a single type for a list of these items,ArrayOfFields
which is used for bothFields
in the Form andKids
in the Fields. It's a list of:[FieldTx,FieldBtn,FieldCh,FieldSig,Field,AnnotWidget]
- I'm ignoring the predicate for FieldSig.This means that we have the following allowed behaviour:
Fields
array that references a widget that has no field (either combined or as a parent)Field
with noFT
, or belong to no field at all.Fields
array can point to elements with aParent
Parent
andKids
arraysKids
I think all of those are disallowed (happy to justify if required), so here's a proposal to remedy this.
To fix the first two issues you could split
ArrayOfFields
intoArrayOfFieldsOrWidgets
. Your types then look likeThe last issues can be done with some magic in your SpecialCase field - we need to check
Kids
because the rules for Fields are:
and for Widgets:
I think we can represent all that with an
fn:Eval
that looks like this (expanded to make it a bit more legible):It's using
/Subtype/Widget
as the test for "is a widget", which is not quite right, and I've also just inventedfn:InArray
, and presumed that==null
is the same as "field is not there" - which probably isn't the case. However I think the logic is correct.Finally, as an alternative if you don't want to go crazy with the special case field, I think we could capture the same logic by splitting
FieldTx
into lots of subtypes egFieldTxNonTerminal
,FieldTxTerminal
,FieldTxTerminalCombined
etc, with the same for the other field types. It's a more declarative but explodes the number of types.Sorry, that's a rough one to start the day with.
The text was updated successfully, but these errors were encountered: