readXmlFile: Read fisheries XML data format file

Description Usage Arguments Value Examples

View source: R/readXmlFile.R

Description

Read fisheries XML data format file. Currently supports IMR Biotic version 1 until 3, IMR Echosounder version 1, and IMR Landing version 2 formats at the moment. Streaming XML pull parser can be used to avoid loading the whole XML into memory and it supports ZIP file reading. Please note that the XML file inside the zip file should be using the same name as the zip file itself (e.g. test.xml inside test.zip).

Usage

1
2
3
4
5
6
7
readXmlFile(
  xmlFilePath,
  stream = TRUE,
  useXsd = NULL,
  usePrefix = NULL,
  verbose = FALSE
)

Arguments

xmlFilePath

full path to the XML file to be read.

stream

a streaming XML pull parser is used if this is set to TRUE. An XML DOM parser is used if this is set to FALSE. Default to TRUE.

useXsd

Specify an xsd object to use. Default to NULL.

usePrefix

Manually specify a namespace prefix. Default to NULL.

verbose

Show verbose output. Default to FALSE.

Value

List of data.table objects containing the "flattened" XML data.

Examples

1
2
3
4
5
6
7
8
9
## Not run: 
# Reading test.xml using XML pull parser
one <- readXmlFile("./test.xml")
# Reading test.xml using XML DOM parser
two <- readXmlFile("./test.xml", stream = FALSE)
# Reading test.xml inside test.zip file
three <- readXmlFile("./test.zip")

## End(Not run)

RstoxData documentation built on July 17, 2021, 5:08 p.m.