Description Usage Arguments Value See Also Examples
This function finds all the XInclude nodes within this document and identifies the included documents. It can operate recursively, finding the included documents within each of those and so on. This is useful for determining if the files are included more than once, if some files in a directory are not included at all, and for obtaining a dependency list, e.g. for use with make rules.
This doesn't deal with XPointer qualifications at this point in time. See #rh-Details.
1 2 3 |
doc |
the XML document to be processed. This can be either the file name (or URL) or the already parsed XML document
returned from
|
recursive |
a logical value indicting whether to find the included documents within the included documents. |
nodes |
a logical value indicating whether we should return the XML include nodes, or the names of the files. This is useful if one wants to modify the nodes or get the xpointer attribute. |
full.names |
a logical value indicating whether we are to give full paths for the files.
If this is |
namespace |
a named character vector giving the namespace definitions for identifying XInclude. There are two in reasonably common use. |
verbose |
a logical indicating whether to emit information about which files are being processed as the search proceeds. |
table |
a logical value which indicates whether to return a frequency table of the include file names. This makes the result more compact if there are many repeated includes. |
The return value depends on the value of different arguments.
If recursive is true and table is TRUE
, a frequency table of the included files is
returned. If table is FALSE
however, then the character vector of all
included file names is returned.
If recursive is FALSE
, then either the include nodes or the
character vector of included files is returned. This is controlled by the value
of nodes. In all cases, if the names of the files are being returned,
the names are converted to normalized path names (typically fully-qualified names) if full.names is
specified.
http://www.w3.org/TR/xinclude/
1 2 3 4 5 6 7 8 9 10 11 12 13 |
# Finding XIncludes in a book
# This identifies the included files in a sample book that uses XInclude to
# bring in the chapters from separate files and a section from separate file.
#
# It converts the file names to fully-qualified paths and operates recursively.
# This gives us the dependency list for the entire book (at the present instance).
f = system.file("sampleDocs", "book.xml", package = "XDocTools")
getXIncludeFiles(f, recursive = TRUE, full.names = TRUE)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.