eml_locate_schema returns the location of the XSD schema file for a given EML document, as shipped with the EML R package.
eml_locate_schema(eml, ns = NA)
eml | an xml2::xml_document instance for an EML document |
---|---|
ns | the namespace URI for the top (root) element |
fully qualified path to the XSD schema for the appropriate version of EML
The schema location is based on the last path component from the EML namespace (e.g., eml-2.1.1), which corresponds to the directory containing xsd files that ship with the EML package. Schema files are copies of the schemas from the EML versioned releases. If an appropriate schema is not found, the function returns FALSE.
f <- system.file("examples", "example-eml-2.1.1.xml", package = "EML") eml <- xml2::read_xml(f) schema <- eml_locate_schema(eml)#> Error in eml_locate_schema(eml): could not find function "eml_locate_schema"