Error line reporting on XML Validation
Added by Jason Callister about 8 years ago
Part of our validation looks for duplicate values in a 'DocRefId'. The error message however reports the parent element closing tag, rather than the offending lines themselves:
198 199 FATCA1 200 000000.99999.SL.833.Client5.0 201
....
223 224 FATCA1 225 000000.99999.SL.833.Client5.0 226
At line 201: Non-unique value found for constraint DocRefID_Unique: "000000.99999.SL.833.Client5.0" At line 226: Non-unique value found for constraint DocRefID_Unique: "000000.99999.SL.833.Client5.0"
Is this expected behaviour?
Replies (1)
RE: Error line reporting on XML Validation - Added by Michael Kay about 8 years ago
I guess your constraint has something like
Now in general there can be more than one field participating in the constraint, and we don't know we've got a non-unique value until we've found all of them; so it's reasonable that the actual checking is done while processing the ftc:DocSpec end tag.
Looking at the code, I don't think it would be too hard to retain the location of the last field of the current tuple of field values, but I'm not actually convinced it's the right thing to do: it's the DocSpec as a whole that's invalid, surely?
Please register to reply