testValid {DDIwR} | R Documentation |
Validate a DDI element.
Description
Attempts a minimal validation of a DDI Codebook element, by searching for mandatory elements and attributes.
Usage
testValid(element, monolang = TRUE)
Arguments
element |
A standard element of class |
monolang |
Logical, the codebook file is monolingual |
Details
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.
Value
A character vector of validation problems found.
Author(s)
Adrian Dusa