Skip to contents

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 idml class object created with read_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 supplied ns parameter.

...

Arguments passed on to get_idml_contents

ns

Optionally, 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 element bar is defined in namespace foo, it will be called foo:bar. (And similarly for attributes). Default namespaces must be given an explicit name. The ns is ignored when using xml_name<-() and xml_set_name().

unique_nm

If TRUE, ensure that parent_node names are unique before using them to extract data from the xml_document. Ignored if node_names is 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 the call argument of abort() 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".