eml_locate_schema: eml_locate_schema

Description Usage Arguments Details Value Examples

View source: R/eml_validate.R

Description

eml_locate_schema returns the location of the XSD schema file for a given EML document, as shipped with the EML R package.

Usage

1

Arguments

eml

an xml2::xml_document instance for an EML document

ns

the namespace URI for the top (root) element

Details

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.

Value

fully qualified path to the XSD schema for the appropriate version of EML

Examples

1
2
3
f <- system.file("examples", "example-eml-2.1.1.xml", package = "EML")
eml <- xml2::read_xml(f)
schema <- eml_locate_schema(eml)

cboettig/emljson documentation built on Dec. 6, 2018, 3:10 p.m.