| testValid | R Documentation |
Checks parent-specific child occurrences, sequences, choices and mandatory attributes throughout a DDI Codebook element.
testValid(element, monolang = TRUE)
element |
A standard element of class |
monolang |
Logical, the codebook file is monolingual |
Each existing instance is checked separately, including repeated
and recursively nested elements. Required children are checked only when
their parent exists. Repeated choices may use different alternatives.
An incomplete element can be built incrementally with addChildren();
testValid() also checks the required minimum occurrences and child order.
Validation follows the curated DDI child model. It does not expand imported markup groups or validate all XML datatypes, ID references or mixed text. Use XML Schema validation on exported XML for those additional checks.
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.
A list of class validation, with character vectors mandatory and
optional. The latter contains missing required attributes of optional
children; both components report validation problems, not recommendations.
Adrian Dusa
makeElement
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.