Attempts a minimal validation of a DDI Codebook element, by searching for mandatory elements and attributes.
testValid(element, monolang = TRUE)A character vector of validation problems found.
A standard element of class "DDI".
Logical, the codebook file is monolingual
Adrian Dusa
This function currently attempts a minimal check for the absolute
most mandatory elements, such as the stdyDscr. An absolute bare version
of this element, filled with arbitrary default values, can be produced with
the function makeElement(), activating its attribute fill.
It also checks for chained expectations, that is element X is mandatory only
if the parent element is present.
Future versions will implement more functionality for recommended elements and attributes, with the intention to provide a 1:1 validation as offered by the "CESSDA Metadata Validator".
To ease the validation of the DDI Codebook XML files, the argument monolang
is activated by default. This means a single attribute xmlang in the main
codeBook element. For multi-language codebooks, an error is flagged if this
argument is missing where appropriate.
makeElement