http://www.omegahat.org/XSL/
to a particular
directory on our local machine and then not have to
modify any of the documents if we move the local files to another
directory, e.g. install a new version in an alternate directory.
This function provides a mechanism to query the catalog to
resolve a URI, PUBLIC or SYSTEM identifier. This is now vectorized, so accepts a character vector of
URIs and recycles type
to have the same length.
If an entry is not resolved via the catalog system,
a NA
is returned for that element.
To leave the value unaltered in this case, use asIs = TRUE
.
catalogResolve(id, type = "uri", asIs = FALSE, debug = FALSE)
TRUE
any element of id
which
is not resolved by the catalog system will be left as given in the
call. If FALSE
, such unresolved elements are identified
by NA
.TRUE
) or not (FALSE
).xmlTreeParse
if(!exists("Sys.setenv")) Sys.setenv = Sys.putenv
Sys.setenv("XML_CATALOG_FILES" = system.file("exampleData", "catalog.xml", package = "XML"))
catalogResolve("-//OASIS//DTD DocBook XML V4.4//EN", "public")
catalogResolve("http://www.omegahat.org/XSL/foo.xsl")
catalogResolve("http://www.omegahat.org/XSL/article.xsl", "uri")
catalogResolve("http://www.omegahat.org/XSL/math.xsl", "uri")
# This one does not resolve anything, returning an empty value.
catalogResolve("http://www.oasis-open.org/docbook/xml/4.1.2/foo.xsl", "uri")
# Vectorized and returns NA for the first and /tmp/html.xsl
# for the second.
catalogAdd("http://made.up.domain", "/tmp")
catalogResolve(c("ddas", "http://made.up.domain/html.xsl"), asIs = TRUE)
Run the code above in your browser using DataLab