XMLgenerators: Generate XML generator functions from XiMpLe.valisity object

Description Usage Arguments Details Value See Also Examples

Description

Takes an object of class XiMpLe.validity and turns it into a character vector of generator functions for each XML node that was defined.

Usage

1
2
3
4
5
6
7
8
9
XMLgenerators(validity, prefix = "XML", checkValidity = TRUE,
  indent.by = "\t", roxygenDocs = FALSE, valParam = "validity",
  replaceChar = "_", dir = NULL, overwrite = FALSE, oneFile = NULL)

## S4 method for signature 'XiMpLe.validity'
XMLgenerators(validity, prefix = "XML",
  checkValidity = TRUE, indent.by = "\t", roxygenDocs = FALSE,
  valParam = "validity", replaceChar = "_", dir = NULL,
  overwrite = FALSE, oneFile = NULL)

Arguments

validity

An dobject of class XiMpLe.validity.

prefix

A character string to be used as a prefix for the resulting function names.

checkValidity

Logical, whether all functions should include a check for valid XML.

indent.by

A charachter string defining how indentation should be done.

roxygenDocs

Logical, whether a skeleton for roxygen2-ish documentation should be added.

valParam

A charachter string, name of the additional parameter to use for validation if checkValidity=TRUE.

replaceChar

A (single) character to be used as an replacement for invalid characters for R parameter names.

dir

A charachter string, path to write files to. If dir=NULL, no files are being written, but the results returned in form of a character vector. If dir is set and the directory does not yet exist, it will be created.

overwrite

Logical, whether existing files should be replaced when dir is set.

oneFile

A charachter string. If set, all functions are to be documented in one single *.Rd file, named like the string.

Details

The resulting code follows these rules:

Value

If dir=NULL a named vector of character strings. Otherwise one or more files are written do the location specified via dir.

See Also

XMLValidity and XiMpLe.validity

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
HTMLish <- XMLValidity(
   children=list(
     body=c("a", "p", "ol", "ul", "strong"),
     head=c("title"),
     html=c("head", "body"),
     li=c("a", "br", "strong"),
     ol=c("li"),
     p=c("a", "br", "ol", "ul", "strong"),
     ul=c("li")
   ),
   attrs=list(
     a=c("href", "name"),
     p=c("align")
   ),
   allChildren=c("!--"),
   allAttrs=c("id", "class"),
   empty=c("br")
)
XMLgenerators(HTMLish)

XiMpLe documentation built on Dec. 13, 2017, 1:04 a.m.