By default, if format = "data.frame", get_idml_fonts() returns a single
data.frame and get_idml_styles(), get_idml_graphic(), and
get_idml_preferences() returns a list of data.frame objects values present
in the input idml object. This format option is still under development and
does not return all available data from the xml_document. Note, for the
get_idml_styles(), the parent_nm argument is ignored and may be removed.
Usage
get_idml_resource(
idml,
resource,
format = "xml_document",
...,
error_call = caller_env()
)
get_idml_fonts(idml, format = "xml_document", parent_nm = NULL, ...)
get_idml_styles(
idml,
format = "xml_document",
type = NULL,
parent_nm = NULL,
...
)
get_idml_graphic(idml, format = "xml_document", parent_nm = NULL, ...)
get_idml_preferences(idml, format = "xml_document", parent_nm = NULL, ...)Arguments
- idml
A
idmlclass object created withread_idml().- resource
One or more resource names: "Graphic.xml", "Fonts.xml", or "Styles.xml"
- format
"list", "xml_document", or "data.frame". If "list", contents are converted with
xml2::as_list()using the suppliednsparameter.- ...
Arguments passed on to
get_idml_contentsnsOptionally, a named vector giving prefix-url pairs, as produced by
xml_ns(). If provided, all names will be explicitly qualified with the ns prefix, i.e. if the elementbaris defined in namespacefoo, it will be calledfoo:bar. (And similarly for attributes). Default namespaces must be given an explicit name. The ns is ignored when usingxml_name<-()andxml_set_name().unique_nmIf
TRUE, ensure that parent_node names are unique before using them to extract data from thexml_document. Ignored ifnode_namesis supplied.
- error_call
The execution environment of a currently running function, e.g.
caller_env(). The function will be mentioned in error messages as the source of the error. See thecallargument ofabort()for more information.- parent_nm
Name of top-level parent node. If parent_nm is a character vector,
extract_doc_df()returns a data frame list.- type
Type of data to extract from chlildren nodes: "attr" (attributes) or "text".