eml_validate: eml_validate

Description Usage Arguments Value Examples

View source: R/eml_validate.R

Description

eml_validate processes an EML document using the XSD schema for the appropriate version of EML and determines if the document is schema-valid as defined by the XSD specification

Usage

1
eml_validate(eml, encoding = "UTF-8", schema = NULL)

Arguments

eml

an eml class object, file, or xml document

encoding

optional, if eml is a file path / an eml and has special characters, one can gives the encoding used by xmlParse.

schema

path to schema

...

additional arguments to eml_write, such as namespaces

Value

Whether the document is valid (logical)

Examples

1
2
3
4
5
6
7
8
 f <- system.file("xsd/test", "eml.xml", package = "EML")

 ## validate given a file name, without needing to parse first
 eml_validate(f)

## Validate given an "eml" object
eml <- read_eml(f)
eml_validate(eml)

clnsmth/EML103 documentation built on May 22, 2019, 5:32 p.m.