loadDocument: Load one or more documents into a Collection via the Zorba...

Description Usage Arguments Value Author(s) References See Also

Description

This function loads one or more documents into the XML manager as Zorba Item objects. These can then be assembled into a collection, for example, and used in a query.

Usage

1
loadDocument(doc, asText = rep(NA, length(doc)), isURI = rep(NA, length(doc)), xmlManager = xmlDataManager())

Arguments

xmlManager

the XML manager instantace associated with the Zorba instance in which we want to use the documents.

doc

a character vector or list giving the documents.

asText

a logical vector that indicates whether each element in doc is the name of a file or document, or the contents of the document itself. We will probably enhance this to look for AsIs objects and treat them as content and regular strings as file/URL names

isURI

a logical vector indicating whether each element is a URI or a regular file name. This is combined with asText.

Value

A zorba::ItemList in which each object is an Item object, a reference to an C++-level object.

Author(s)

Duncan Temple Lang

References

XQuery http://www.w3.org/TR/xquery/

Zorba http://www.zorba-xquery.com/

See Also

mgr = xmlDataManager() # only the first 9 senate bills. billsDir = system.file("sampleDocs", "bills", package = "RXQuery") filenames = list.files(billsDir, pattern = "s[1-9].*.xml", full.names = TRUE) items = loadDocument(mgr, filenames) col = createCollection(mgr, "http://www.govtrack.org/bills") q = 'for $ti in collection("http://www.govtrack.org/bills")/*/introduced/@datetime return $ti;'

e = xquery(q)


omegahat/RXQuery documentation built on May 24, 2019, 1:55 p.m.