pasteXML-methods: Paste methods for XiMpLe XML objects

pasteXMLR Documentation

Paste methods for XiMpLe XML objects

Description

These methods can be used to paste objects if class XiMpLe_node or XiMpLe_doc.

Usage

pasteXML(obj, ...)

## S4 method for signature 'XiMpLe_node'
pasteXML(
  obj,
  level = 1,
  shine = 1,
  indent.by = getOption("XiMpLe_indent", "\t"),
  tidy = TRUE,
  tidy.omit = c("![CDATA[", "*![CDATA["),
  as_script = FALSE,
  func_rename = c(`?xml_` = "xml_", `!--_` = "comment_", `![CDATA[_` = "CDATA_",
    `!DOCTYPE_` = "DOCTYPE_")
)

## S4 method for signature 'XiMpLe_doc'
pasteXML(
  obj,
  shine = 1,
  indent.by = getOption("XiMpLe_indent", "\t"),
  tidy = TRUE,
  tidy.omit = c("![CDATA[", "*![CDATA["),
  as_script = FALSE,
  func_rename = c(`?xml_` = "xml_", `!--_` = "comment_", `![CDATA[_` = "CDATA_",
    `!DOCTYPE_` = "DOCTYPE_")
)

Arguments

obj

An object of class XiMpLe_node or XiMpLe_doc.

...

Additional options for the generic method, see options for a specific method, respectively.

level

Indentation level.

shine

Integer, controlling if the output should be formatted for better readability. Possible values:

0

No formatting.

1

Nodes will be indented.

2

Nodes will be indented and each attribute gets a new line.

indent.by

A charachter string defining how indentation should be done. Defaults to tab.

tidy

Logical, if TRUE the special characters "<" and ">" will be replaced with the entities "&lt;" and "gt;" in attributes and text values.

tidy.omit

A character vector with node names that should be excluded from tidy.

as_script

Logical, if TRUE, tags will be pasted as a sketch for a script to be run in conjunction with functions generated by gen_tag_functions. This script code will most likely not run without adjustments, but is perhaps a good start anyway.

func_rename

Named character vector defining which tags' functions should get a different name. This makes it easier to get functions with valid names that generate special tag nodes. Only used when as_script=TRUE. Use the same names and values as you used in gen_tag_functions.

Note

The functions pasteXMLNode() and pasteXMLTree() have been replaced by the pasteXML methods. They should no longer be used.

See Also

XiMpLe_node, XiMpLe_doc


rkward-community/XiMpLe documentation built on March 6, 2023, 5:28 a.m.