The function generates an XML nodeset that contains the contributors' name, affiliation, and their CRediT roles with a structure outlined in the JATS 1.2 DTD specifications (eLife). The output is generated from an contributors_table validated with the validate_contributors_table() function. The contributors_table must be based on the contributors_table_template().

print_xml(contributors_table)

Arguments

contributors_table

validated contributors_table

Value

The function returns an xml nodeset containing the contributors listed for each CRediT role they partake in.

Warning

The function is primarily developed to be the part of a shiny app. As the validation is handled inside of the app separately, the function can break with non-informative errors if running locally without first validating it.

See also

Other output functions: print_credit_roles(), print_funding(), print_title_page(), print_yaml()

Examples

example_contributors_table <- read_contributors_table( contributors_table = system.file("extdata", "contributors_table_example.csv", package = "tenzing", mustWork = TRUE))
#> Rows: 5 Columns: 24
#> ── Column specification ──────────────────────────────────────────────────────── #> Delimiter: "," #> chr (7): Firstname, Middle name, Surname, Email address, Primary affiliatio... #> dbl (1): Order in publication #> lgl (16): Conceptualization, Data curation, Formal analysis, Funding acquisi...
#> #> Use `spec()` to retrieve the full column specification for this data. #> Specify the column types or set `show_col_types = FALSE` to quiet this message.
validate_contributors_table(contributors_table = example_contributors_table)
#> $missing_surname #> $missing_surname$type #> [1] "success" #> #> $missing_surname$message #> [1] "There are no missing surnames." #> #> #> $missing_firstname #> $missing_firstname$type #> [1] "success" #> #> $missing_firstname$message #> [1] "There are no missing firstnames." #> #> #> $duplicate_names #> $duplicate_names$type #> [1] "success" #> #> $duplicate_names$message #> [1] "There are no duplicate names in the contributors_table." #> #> #> $duplicate_initials #> $duplicate_initials$type #> [1] "success" #> #> $duplicate_initials$message #> [1] "There are no duplicate initials in the contributors_table." #> #> #> $missing_order #> $missing_order$type #> [1] "success" #> #> $missing_order$message #> [1] "There are no missing values in the order of publication." #> #> #> $duplicate_order #> $duplicate_order$type #> [1] "success" #> #> $duplicate_order$message #> [1] "There are no duplicated order numbers in the contributors_table." #> #> #> $missing_affiliation #> $missing_affiliation$type #> [1] "success" #> #> $missing_affiliation$message #> [1] "There are no missing affiliations in the contributors_table." #> #> #> $missing_corresponding #> $missing_corresponding$type #> [1] "success" #> #> $missing_corresponding$message #> [1] "There is at least one author indicated as corresponding author." #> #> #> $missing_credit #> $missing_credit$type #> [1] "success" #> #> $missing_credit$message #> [1] "All authors have at least one CRediT statement checked." #> #> #> $missing_email #> $missing_email$type #> [1] "success" #> #> $missing_email$message #> [1] "There are email addresses provided for all corresponding authors." #> #>
print_xml(contributors_table = example_contributors_table)
#> {xml_document} #> <contrib-group> #> [1] <contrib>\n <name surname="Aczel" given-names="Balazs"/>\n <role vocab= ... #> [2] <contrib>\n <name surname="Aust" given-names="Frederik"/>\n <role vocab ... #> [3] <contrib>\n <name surname="Colomb" given-names="Julien"/>\n <role vocab ... #> [4] <contrib>\n <name surname="Holcombe" given-names="Alex O."/>\n <role vo ... #> [5] <contrib>\n <name surname="Kovacs" given-names="Marton"/>\n <role vocab ...