sheet2xml | R Documentation |
It reads a spreadsheet file (Excel or ODS), processes it using a provided XML template, and generates an XML output file.
sheet2xml(file_path, template_path, xml_path = NULL, optimize = FALSE)
file_path |
Character. Path to the spreadsheet file to be converted. Supports Excel (.xlsx) and ODS formats. |
template_path |
Character. Path to the XML template file to guide the transformation process. |
xml_path |
Character (optional). Output path for the generated XML file. If NULL, it is considered an XML file with the same name and location as the spreadsheet file. |
optimize |
Boolean. Remove empty nodes from the xml file. |
Character. The file path of the generated XML document.
source_xml <- system.file("extdata", "schema_template.xml", package = "tab2xml")
source_xlsx <- system.file("extdata", "schema.xlsx", package = "tab2xml")
temp_file1 <- tempfile(fileext = ".xml")
sheet2xml(source_xlsx, source_xml, temp_file1)
source_ods <- system.file("extdata", "schema.ods", package = "tab2xml")
temp_file2 <- tempfile(fileext = ".xml")
sheet2xml(source_ods, source_xml, temp_file2)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.