rk.XML.convert: Create XML node convert for RKWard plugins

View source: R/rk.XML.convert.R

rk.XML.convertR Documentation

Create XML node convert for RKWard plugins

Description

If sources holds XiMpLe.node objects, the validity of modifiers is automatically checked for that tag.

Usage

rk.XML.convert(sources, mode = c(), required = FALSE, id.name = "auto")

Arguments

sources

A list with at least one value, either resembling the id of an existing element to be queried as a character string, or a previously defined object of class XiMpLe.node (whose id will be extracted and used). If you want to examine e.g. the state or string value specificly, just name the value accoringly, e.g., sources=list("vars0", string="input1", state="chkbx2").

mode

A named vector with either exactly one of the following elements:

  • equalsTrue if sources equals this value.

  • notequalsTrue if sources differs from this value.

  • andTrue if all sources are true. The sources must be boolean, and the actual value here is irrelevant, so mode=c(and="") is valid.

  • orTrue if any of the sources is true. The sources must be boolean, and the actual value here is irrelevant, so mode=c(or="") is valid.

or at least one of these elemets:

  • minTrue if sources is at least this value. They must be numeric.

  • maxTrue if sources is below this value. They must be numeric.

required

Logical, sets the state of the required_true attribute. If TRUE, the plugin submit button is only enabled if this property is true.

id.name

Character string, a unique ID for this plugin element. If "auto", an ID will be generated automatically from the sources and mode value.

Value

An object of class XiMpLe.node.

Note

To get a list of the implemented modifiers for sources in this package see modifiers.

See Also

rk.XML.connect, rk.XML.external, rk.XML.logic, rk.XML.set, rk.XML.switch, modifiers, and the Introduction to Writing Plugins for RKWard

Examples

test.convert <- rk.XML.convert(list(string="foo"), mode=c(notequals="bar"))
cat(pasteXML(test.convert))

rkward-community/rkwarddev documentation built on May 9, 2022, 3:02 p.m.