data-to-insight / csc-validator-be-cin

1 stars 1 forks source link

Bug: Rule 8842Q - False positives #384

Closed SLornieCYC closed 1 year ago

SLornieCYC commented 1 year ago

Describe the bug The DFE XML Generator tool creates a self-closing review tag (i.e. <Reviews/>) when a child is listed in the Reviews table but does not have a review date. These tags are flagged up in the CIN Validator as incorrect for this rule but not in the DFE portal.

I think this rule (or Ingress?) needs to distinguish between <Reviews/> and (at a guess?) <Reviews><CPPreviewDate></CPPreviewDate></Reviews> or <Reviews><CPPreviewDate/></Reviews>.

WillLP-code commented 1 year ago

Removing CPPreviewDate but not Reviews from CIN_Census_2021 causes the child to fail 8842Q replicating Stephen's bug report

EDIT: I'm recreating it more properly now by adding a self closing block inside reviews. I htink the solution will be to not make reviews tables for children with these in the ingress for loop.

WillLP-code commented 1 year ago

After a bit of digging, ETree has a way to find self closing elements, they're referred to as short_empty_elements, however, at the moment all I can find is info on writing SEEs into your XML when building one, not skipping reading them when using et.findall()

tab1tha commented 1 year ago

I am unable to reproduce this bug in my local environment. However, the logic of the bug find and fix does make sense.