OAIHarvester (version 0.3-1)

transform: Transform OAI-PMH XML Results

Description

Transform OAI-PMH XML results to “useful” R data structures (lists of character vectors or XML nodes) for further processing or analysis.

Usage

oaih_transform(x)

Arguments

x

an XML node, or a list of character vectors or XML nodes.

Value

A list of character vectors or XML nodes, arranged as a matrix in the “list context”.

Details

In a “list context”, i.e., if x conceptually contains information on several cases, transformation gives a “list matrix” (a list of character vector or XML node observations with a dim attribute) providing a rectangular case by variables data layout; otherwise, a list of variables. See the vignette for details.

Examples

Run this code
# NOT RUN {
baseurl <- "http://epub.wu.ac.at/cgi/oai2"
## Get a single record to save bandwidth.
x <- oaih_get_record(baseurl,
                     "oai:epub.wu-wien.ac.at:852",
                     transform = FALSE)
## The result of the request is a single OAI-PMH XML <record> node:
x
## Transform this (turning identifier, datestamp and setSpec into
## character data):
x <- oaih_transform(x)
x    
## This has its metadata in the default Dublin Core form, encoded in
## XML.  Transform these to character data:
oaih_transform(x$metadata)
# }

Run the code above in your browser using DataCamp Workspace